diff --git a/LICENSE b/LICENSE index 832b4efb5..42af8c10c 100644 --- a/LICENSE +++ b/LICENSE @@ -27,32 +27,50 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------- +License for src/common/convert_UTF.cc, src/common/convert_UTF.h -Copyright 2001-2004 Unicode, Inc. +Copyright © 1991-2015 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in +http://www.unicode.org/copyright.html. -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. +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. -Limitations on Rights to Redistribute This Code +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. -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. +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. -------------------------------------------------------------------- +License for src/common/linux/breakpad_getcontext.S libunwind - a platform-independent unwind library Copyright (C) 2008 Google, Inc - Contributed by Paul Pluzhnikov + Contributed by Paul Pluzhnikov Copyright (C) 2010 Konstantin Belousov Permission is hereby granted, free of charge, to any person obtaining @@ -75,29 +93,270 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -------------------------------------------------------------------- +License for +src/client/mac/handler/breakpad_nlist_64.cc +src/third_party/mac_headers/architecture/byte_order.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 -Copyright (c) 1999 Apple Computer, Inc. All rights reserved. +APPLE PUBLIC SOURCE LICENSE -@APPLE_LICENSE_HEADER_START@ +Version 2.0 - August 6, 2003 -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. +Please read this License carefully before downloading this software. By +downloading or using this software, you are agreeing to be bound by the terms +of this License. If you do not or cannot agree to the terms of this License, +please do not download or use the software. -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 Note: In January 2007, Apple changed its corporate name from "Apple +Computer, Inc." to "Apple Inc." This change has been reflected below and +copyright years updated, but no other changes have been made to the APSL 2.0. + +1. General; Definitions. This License applies to any program or other work which Apple Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License: + +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the +grantor of rights, (i) claims of patents that are now or hereafter acquired, +owned by or assigned to Apple and (ii) that cover subject matter contained in +the Original Code, but only to the extent necessary to use, reproduce and/or +distribute the Original Code without infringement; and (b) in the case where +You are the grantor of rights, (i) claims of patents that are now or hereafter +acquired, owned by or assigned to You and (ii) that cover subject matter in +Your Modifications, taken alone or in combination with Original Code. + +1.2 "Contributor" means any person or entity that creates or contributes to +the creation of Modifications. + +1.3 "Covered Code" means the Original Code, Modifications, the combination of +Original Code and any Modifications, and/or any respective portions thereof. + +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make +Covered Code available, directly or indirectly, to anyone other than You; +and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way +to provide a service, including but not limited to delivery of content, +through electronic communication with a client other than You. + +1.5 "Larger Work" means a work which combines Covered Code or portions thereof +with code not governed by the terms of this License. + +1.6 "Modifications" mean any addition to, deletion from, and/or change to, the +substance and/or structure of the Original Code, any previous Modifications, +the combination of Original Code and any previous Modifications, and/or any +respective portions thereof. When code is released as a series of files, a +Modification is: (a) any addition to or deletion from the contents of a file +containing Covered Code; and/or (b) any new file or other representation of +computer program statements that contains any part of Covered Code. + +1.7 "Original Code" means (a) the Source Code of a program or other work as +originally made available by Apple under this License, including the Source +Code of any updates or upgrades to such programs or works made available by +Apple under this License, and that has been expressly identified by Apple as +such in the header file(s) of such work; and (b) the object code compiled from +such Source Code and originally made available by Apple under this License + +1.8 "Source Code" means the human readable form of a program or other work +that is suitable for making modifications to it, including all modules it +contains, plus any associated interface definition files, scripts used to +control compilation and installation of an executable (object code). + +1.9 "You" or "Your" means an individual or a legal entity exercising rights +under this License. For legal entities, "You" or "Your" includes any entity +which controls, is controlled by, or is under common control with, You, where +"control" means (a) the power, direct or indirect, to cause the direction or +management of such entity, whether by contract or otherwise, or (b) ownership +of fifty percent (50%) or more of the outstanding shares or beneficial +ownership of such entity. + +2. Permitted Uses; Conditions & Restrictions. Subject to the terms and conditions of this License, Apple hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Apple's Applicable Patent Rights and copyrights covering the Original Code, to do the following: + +2.1 Unmodified Code. You may use, reproduce, display, perform, internally +distribute within Your organization, and Externally Deploy verbatim, +unmodified copies of the Original Code, for commercial or non-commercial +purposes, provided that in each instance: + +(a) You must retain and reproduce in all copies of Original Code the copyright +and other proprietary notices and disclaimers of Apple as they appear in the +Original Code, and keep intact all notices in the Original Code that refer to +this License; and + +(b) You must include a copy of this License with every copy of Source Code of +Covered Code and documentation You distribute or Externally Deploy, and You +may not offer or impose any terms on such Source Code that alter or restrict +this License or the recipients' rights hereunder, except as permitted +under Section 6. + +2.2 Modified Code. You may modify Covered Code and use, reproduce, display, +perform, internally distribute within Your organization, and Externally Deploy +Your Modifications and Covered Code, for commercial or non-commercial +purposes, provided that in each instance You also meet all of these +conditions: + +(a) You must satisfy all the conditions of Section 2.1 with respect to the +Source Code of the Covered Code; + +(b) You must duplicate, to the extent it does not already exist, the notice in +Exhibit A in each file of the Source Code of all Your Modifications, and cause +the modified files to carry prominent notices stating that You changed the +files and the date of any change; and + +(c) If You Externally Deploy Your Modifications, You must make Source Code of +all Your Externally Deployed Modifications either available to those to whom +You have Externally Deployed Your Modifications, or publicly available. Source +Code of Your Externally Deployed Modifications must be released under the +terms set forth in this License, including the license grants set forth in +Section 3 below, for as long as you Externally Deploy the Covered Code or +twelve (12) months from the date of initial External Deployment, whichever is +longer. You should preferably distribute the Source Code of Your Externally +Deployed Modifications electronically (e.g. download from a web site). + +2.3 Distribution of Executable Versions. In addition, if You Externally Deploy +Covered Code (Original Code and/or Modifications) in object code, executable +form only, You must include a prominent notice, in the code itself as well as +in related documentation, stating that Source Code of the Covered Code is +available under the terms of this License with information on how and where to +obtain such Source Code. + +2.4 Third Party Rights. You expressly acknowledge and agree that although +Apple and each Contributor grants the licenses to their respective portions of +the Covered Code set forth herein, no assurances are provided by Apple or any +Contributor that the Covered Code does not infringe the patent or other +intellectual property rights of any other entity. Apple and each Contributor +disclaim any liability to You for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a condition to +exercising the rights and licenses granted hereunder, You hereby assume sole +responsibility to secure any other intellectual property rights needed, if +any. For example, if a third party patent license is required to allow You to +distribute the Covered Code, it is Your responsibility to acquire that license +before distributing the Covered Code. + +3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License, You hereby grant to any person or entity receiving or distributing Covered Code under this License a non-exclusive, royalty-free, perpetual, irrevocable license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, sublicense, distribute and Externally Deploy Your Modifications of the same scope and extent as Apple's licenses under Sections 2.1 and 2.2 above. + +4. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof. + +5. Limitations on Patent License. Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Apple herein. Modifications and/or Larger Works may require additional patent licenses from Apple which Apple may grant in its sole discretion. + +6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Apple or any Contributor. You must obtain the recipient's agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Apple and every Contributor harmless for any liability incurred by or claims asserted against Apple or such Contributor by reason of any such Additional Terms. + +7. Versions of the License. Apple may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Apple. No one other than Apple has the right to modify the terms applicable to Covered Code created under this License. + +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage. + +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple's total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of fifty dollars ($50.00). + +10. Trademarks. This License does not grant any rights to use the trademarks or trade names "Apple", "Mac", "Mac OS", "QuickTime", "QuickTime Streaming Server" or any other trademarks, service marks, logos or trade names belonging to Apple (collectively "Apple Marks") or to any trademark, service mark, logo or trade name belonging to any Contributor. You agree not to use any Apple Marks in or as part of the name of products derived from the Original Code or to endorse or promote products derived from the Original Code other than as expressly permitted by and in strict compliance at all times with Apple's third party trademark usage guidelines which are posted at http://www.apple.com/legal/guidelinesfor3rdparties.html. + +11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Apple retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Apple ("Apple Modifications"), and such Apple Modifications will not be automatically subject to this License. Apple may, at its sole discretion, choose to license such Apple Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all. + +12. Termination. + +12.1 Termination. This License and the rights granted hereunder will +terminate: + +(a) automatically without notice from Apple if You fail to comply with any +term(s) of this License and fail to cure such breach within 30 days of +becoming aware of such breach; + +(b) immediately in the event of the circumstances described in Section +13.5(b); or + +(c) automatically without notice from Apple if You, at any time during the +term of this License, commence an action for patent infringement against +Apple; provided that Apple did not first commence an action for patent +infringement against You in that instance. + +12.2 Effect of Termination. Upon termination, You agree to immediately stop +any further use, reproduction, modification, sublicensing and distribution of +the Covered Code. All sublicenses to the Covered Code which have been properly +granted prior to termination shall survive any termination of this License. +Provisions which, by their nature, should remain in effect beyond the +termination of this License shall survive, including but not limited to +Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other +for compensation, indemnity or damages of any sort solely as a result of +terminating this License in accordance with its terms, and termination of this +License will be without prejudice to any other right or remedy of any party. + +13. Miscellaneous. + +13.1 Government End Users. The Covered Code is a "commercial item" as defined +in FAR 2.101. Government software and technical data rights in the Covered +Code include only those rights customarily provided to the public as defined +in this License. This customary commercial license in technical data and +software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 +(Computer Software) and, for Department of Defense purchases, DFAR +252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in +Commercial Computer Software or Computer Software Documentation). Accordingly, +all U.S. Government End Users acquire Covered Code with only those rights set +forth herein. + +13.2 Relationship of Parties. This License will not be construed as creating +an agency, partnership, joint venture or any other form of legal association +between or among You, Apple or any Contributor, and You will not represent to +the contrary, whether expressly, by implication, appearance or otherwise. + +13.3 Independent Development. Nothing in this License will impair Apple's +right to acquire, license, develop, have others develop for it, market and/or +distribute technology or products that perform the same or similar functions +as, or otherwise compete with, Modifications, Larger Works, technology or +products that You may develop, produce, market or distribute. + +13.4 Waiver; Construction. Failure by Apple or any Contributor to enforce any +provision of this License will not be deemed a waiver of future enforcement of +that or any other provision. Any law or regulation which provides that the +language of a contract shall be construed against the drafter will not apply +to this License. + +13.5 Severability. (a) If for any reason a court of competent jurisdiction +finds any provision of this License, or portion thereof, to be unenforceable, +that provision of the License will be enforced to the maximum extent +permissible so as to effect the economic benefits and intent of the parties, +and the remainder of this License will continue in full force and effect. (b) +Notwithstanding the foregoing, if applicable law prohibits or restricts You +from fully and/or specifically complying with Sections 2 and/or 3 or prevents +the enforceability of either of those Sections, this License will immediately +terminate and You must immediately discontinue any use of the Covered Code and +destroy all copies of it that are in your possession or control. + +13.6 Dispute Resolution. Any litigation or other dispute resolution between +You and Apple relating to this License shall take place in the Northern +District of California, and You and Apple hereby consent to the personal +jurisdiction of, and venue in, the state and federal courts within that +District with respect to this License. The application of the United Nations +Convention on Contracts for the International Sale of Goods is expressly +excluded. + +13.7 Entire Agreement; Governing Law. This License constitutes the entire +agreement between the parties with respect to the subject matter hereof. This +License shall be governed by the laws of the United States and the State of +California, except that body of California law concerning conflicts of law. + +Where You are located in the province of Quebec, Canada, the following clause +applies: The parties hereby confirm that they have requested that this License +and all related documents be drafted in English. Les parties ont exigé que le +présent contrat et tous les documents connexes soient rédigés en anglais. + +EXHIBIT A. + +"Portions Copyright (c) 1999-2007 Apple Inc. All Rights Reserved. + +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. -@APPLE_LICENSE_HEADER_END@ +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." -------------------------------------------------------------------- +License for +src/client/mac/handler/breakpad_nlist_64.cc +src/third_party/mac_headers/mach-o/nlist.h Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. @@ -129,3 +388,681 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +License for +src/third_party/curl/curl.h +src/third_party/curl/curlbuild.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 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1996 - 2011, Daniel Stenberg, . + +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. + +-------------------------------------------------------------------- +License for +src/common/mac/GTMDefines.h +src/common/mac/GTMLogger.h +src/common/mac/GTMLogger.m +src/common/mac/testing/GTMSenTestCase.h +src/common/mac/testing/GTMSenTestCase.m + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other +entities that control, are controlled by, or are under common control with +that entity. For the purposes of this definition, "control" means (i) the +power, direct or indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (ii) ownership of fifty percent +(50%) or more of the outstanding shares, or (iii) beneficial ownership of such +entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, and +configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object +code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice that is +included in or attached to the work (an example is provided in the Appendix +below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative +Works shall not include works that remain separable from, or merely link (or +bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor for +inclusion in the Work by the copyright owner or by an individual or Legal +Entity authorized to submit on behalf of the copyright owner. For the purposes +of this definition, "submitted" means any form of electronic, verbal, or +written communication sent to the Licensor or its representatives, including +but not limited to communication on electronic mailing lists, source code +control systems, and issue tracking systems that are managed by, or on behalf +of, the Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise designated +in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +(a) You must give any other recipients of the Work or Derivative Works a copy +of this License; and + +(b) You must cause any modified files to carry prominent notices stating that +You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works that You +distribute, all copyright, patent, trademark, and attribution notices from the +Source form of the Work, excluding those notices that do not pertain to any +part of the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its distribution, +then any Derivative Works that You distribute must include a readable copy of +the attribution notices contained within such NOTICE file, excluding those +notices that do not pertain to any part of the Derivative Works, in at least +one of the following places: within a NOTICE text file distributed as part of +the Derivative Works; within the Source form or documentation, if provided +along with the Derivative Works; or, within a display generated by the +Derivative Works, if and wherever such third-party notices normally appear. +The contents of the NOTICE file are for informational purposes only and do not +modify the License. You may add Your own attribution notices within Derivative +Works that You distribute, alongside or as an addendum to the NOTICE text from +the Work, provided that such additional attribution notices cannot be +construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a +whole, provided Your use, reproduction, and distribution of the Work otherwise +complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------------------------------------------------------- +License for INSTALL + +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. + +-------------------------------------------------------------------- +License for src/common/mac/testing/GTMSenTestCase.h + +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 THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- +License for src/third_party//libdisasm + + The "Clarified Artistic License" + + Preamble + +The intent of this document is to state the conditions under which a +Package may be copied, such that the Copyright Holder maintains some +semblance of artistic control over the development of the package, +while giving the users of the package the right to use and distribute +the Package in a more-or-less customary fashion, plus the right to make +reasonable modifications. + +Definitions: + + "Package" refers to the collection of files distributed by the + Copyright Holder, and derivatives of that collection of files + created through textual modification. + + "Standard Version" refers to such a Package if it has not been + modified, or has been modified in accordance with the wishes + of the Copyright Holder as specified below. + + "Copyright Holder" is whoever is named in the copyright or + copyrights for the package. + + "You" is you, if you're thinking about copying or distributing + this Package. + + "Distribution fee" is a fee you charge for providing a copy of this + Package to another party. + + "Freely Available" means that no fee is charged for the right to use + the item, though there may be fees involved in handling the item. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications +derived from the Public Domain, or those made Freely Available, or from +the Copyright Holder. A Package modified in such a way shall still be +considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided +that you insert a prominent notice in each changed file stating how and +when you changed that file, and provided that you do at least ONE of the +following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or + an equivalent medium, or placing the modifications on a major archive + site allowing unrestricted access to them, or by allowing the Copyright + Holder to include your modifications in the Standard Version of the + Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict + with standard executables, which must also be provided, and provide + a separate manual page for each non-standard executable that clearly + documents how it differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + + e) permit and encourge anyone who receives a copy of the modified Package + permission to make your modifications Freely Available in some specific + way. + +4. You may distribute the programs of this Package in object code or +executable form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where + to get the Standard Version. + + b) accompany the distribution with the machine-readable source of + the Package with your modifications. + + c) give non-standard executables non-standard names, and clearly + document the differences in manual pages (or equivalent), together + with instructions on where to get the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + + e) offer the machine-readable source of the Package, with your + modifications, by mail order. + +5. You may charge a distribution fee for any distribution of this Package. +If you offer support for this Package, you may charge any fee you choose +for that support. You may not charge a license fee for the right to use +this Package itself. You may distribute this Package in aggregate with +other (possibly commercial and possibly nonfree) programs as part of a +larger (possibly commercial and possibly nonfree) software distribution, +and charge license fees for other parts of that software distribution, +provided that you do not advertise this Package as a product of your own. +If the Package includes an interpreter, You may embed this Package's +interpreter within an executable of yours (by linking); this shall be +construed as a mere form of aggregation, provided that the complete +Standard Version of the interpreter is so embedded. + +6. The scripts and library files supplied as input to or produced as +output from the programs of this Package do not automatically fall +under the copyright of this Package, but belong to whoever generated +them, and may be sold commercially, and may be aggregated with this +Package. If such scripts or library files are aggregated with this +Package via the so-called "undump" or "unexec" methods of producing a +binary executable image, then distribution of such an image shall +neither be construed as a distribution of this Package nor shall it +fall under the restrictions of Paragraphs 3 and 4, provided that you do +not represent such an executable image as a Standard Version of this +Package. + +7. C subroutines (or comparably compiled subroutines in other +languages) supplied by you and linked into this Package in order to +emulate subroutines and variables of the language defined by this +Package shall not be considered part of this Package, but are the +equivalent of input as in Paragraph 6, provided these subroutines do +not change the language in any way that would cause it to fail the +regression tests for the language. + +8. Aggregation of the Standard Version of the Package with a commercial +distribution is always permitted provided that the use of this Package is +embedded; that is, when no overt attempt is made to make this Package's +interfaces visible to the end user of the commercial distribution. +Such use shall not be construed as a distribution of this Package. + +9. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + The End + +-------------------------------------------------------------------- +License for Autotools + +AUTOCONF CONFIGURE SCRIPT EXCEPTION + +Version 3.0, 18 August 2009 + +Copyright © 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +This Exception is an additional permission under section 7 of the GNU General +Public License, version 3 ("GPLv3"). It applies to a given file that bears a +notice placed by the copyright holder of the file stating that the file is +governed by GPLv3 along with this Exception. + +The purpose of this Exception is to allow distribution of Autoconf's +typical output under terms of the recipient's choice (including +proprietary). + +0. Definitions. +"Covered Code" is the source or object code of a version of Autoconf that is a +covered work under this License. + +"Normally Copied Code" for a version of Autoconf means all parts of its +Covered Code which that version can copy from its code (i.e., not from its +input file) into its minimally verbose, non-debugging and non-tracing output. + +"Ineligible Code" is Covered Code that is not Normally Copied Code. + +1. Grant of Additional Permission. +You have permission to propagate output of Autoconf, even if such propagation +would otherwise violate the terms of GPLv3. However, if by modifying Autoconf +you cause any Ineligible Code of the version you received to become Normally +Copied Code of your modified version, then you void this Exception for the +resulting covered work. If you convey that resulting covered work, you must +remove this Exception in accordance with the second paragraph of Section 7 of +GPLv3. + +2. No Weakening of Autoconf Copyleft. +The availability of this Exception does not imply any general presumption that +third-party software is unaffected by the copyleft requirements of the license +of Autoconf. + +-------------------------------------------------------------------- +License for Autotools + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, 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 or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +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 give any other recipients of the Program a copy of this License +along with the Program. + +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 Program or any portion +of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +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 Program, 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 Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) 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; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, 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 executable. However, as a +special exception, the source code 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. + +If distribution of executable or 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 counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program 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. + + 5. 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 Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program 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 to +this License. + + 7. 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 Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program 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 Program. + +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. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program 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. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 Program +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 Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, 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 + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +Autoconf Exception + +As a special exception, the Free Software Foundation gives unlimited +permission to copy, distribute and modify the configure scripts that are the +output of Autoconf. 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 Autoconf appear in them. The GNU General Public License (GPL) does +govern all other use of the material that constitutes the Autoconf program. + +Certain portions of the Autoconf source text are designed to be copied (in +certain cases, depending on the input) into the output of Autoconf. We call +these the "data" portions. The rest of the Autoconf source text consists of +comments plus executable code that decides which of the data portions to +output in any given case. We call these comments and executable code the "non- +data" portions. Autoconf never copies any of the non-data portions into its +output. + +This special exception to the GPL applies to versions of Autoconf released by +the Free Software Foundation. When you make and distribute a modified version +of Autoconf, you may extend this special exception to the GPL to apply to your +modified version as well, *unless* your modified version has the potential to +copy into its output some of the text that was the non-data portion of the +version that you started with. (In other words, unless your change moves or +copies text from the non-data portions to the data portions.) If your +modification has such potential, you must delete any notice of this special +exception to the GPL from your modified version. + + diff --git a/Makefile.am b/Makefile.am index 9e66a6852..1d45f8e56 100644 --- a/Makefile.am +++ b/Makefile.am @@ -151,7 +151,6 @@ CLEANFILES = # if !SYSTEM_TEST_LIBS check_LIBRARIES += src/testing/libtesting.a -endif src_testing_libtesting_a_SOURCES = \ src/breakpad_googletest_includes.h \ src/testing/googletest/src/gtest-all.cc \ @@ -159,6 +158,7 @@ src_testing_libtesting_a_SOURCES = \ src/testing/googlemock/src/gmock-all.cc src_testing_libtesting_a_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) +endif # # General @@ -193,7 +193,6 @@ check_PROGRAMS += \ src/processor/basic_source_line_resolver_unittest \ src/processor/cfi_frame_info_unittest \ src/processor/contained_range_map_unittest \ - src/processor/disassembler_objdump_unittest \ src/processor/disassembler_x86_unittest \ src/processor/exploitability_unittest \ src/processor/fast_source_line_resolver_unittest \ @@ -221,6 +220,12 @@ check_PROGRAMS += \ src/processor/stackwalker_riscv64_unittest \ src/processor/stackwalker_x86_unittest \ src/processor/synth_minidump_unittest +if LINUX_HOST +check_PROGRAMS += \ + src/processor/disassembler_objdump_unittest \ + src/common/linux/scoped_pipe_unittest \ + src/common/linux/scoped_tmpfile_unittest +endif LINUX_HOST if SELFTEST check_PROGRAMS += \ src/processor/stackwalker_selftest @@ -366,8 +371,6 @@ src_libbreakpad_a_SOURCES = \ src/processor/contained_range_map.h \ src/processor/convert_old_arm64_context.cc \ src/processor/convert_old_arm64_context.h \ - src/processor/disassembler_objdump.h \ - src/processor/disassembler_objdump.cc \ src/processor/disassembler_x86.h \ src/processor/disassembler_x86.cc \ src/processor/dump_context.cc \ @@ -449,6 +452,15 @@ src_libbreakpad_a_SOURCES = \ src/processor/symbolic_constants_win.h \ src/processor/tokenize.cc \ src/processor/tokenize.h +if LINUX_HOST +src_libbreakpad_a_SOURCES += \ + src/common/linux/scoped_pipe.h \ + src/common/linux/scoped_pipe.cc \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ + src/processor/disassembler_objdump.h \ + src/processor/disassembler_objdump.cc +endif # libdisasm 3rd party library src_third_party_libdisasm_libdisasm_a_SOURCES = \ @@ -523,7 +535,6 @@ src_client_linux_libbreakpad_client_a_SOURCES += \ endif # Client tests - 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) @@ -552,7 +563,10 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ 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/scoped_pipe.h \ + src/common/linux/scoped_pipe.cc \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ src/common/memory_allocator_unittest.cc \ src/common/tests/auto_tempdir.h \ @@ -911,7 +925,6 @@ src_processor_exploitability_unittest_LDADD = \ src/processor/convert_old_arm64_context.o \ src/processor/minidump_processor.o \ src/processor/process_state.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -947,12 +960,38 @@ src_processor_exploitability_unittest_LDADD = \ src/third_party/libdisasm/libdisasm.a \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_exploitability_unittest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif + +src_common_linux_scoped_pipe_unittest_SOURCES = \ + src/common/linux/scoped_pipe_unittest.cc +src_common_linux_scoped_pipe_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_common_linux_scoped_pipe_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_common_linux_scoped_tmpfile_unittest_SOURCES = \ + src/common/linux/scoped_tmpfile_unittest.cc +src_common_linux_scoped_tmpfile_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) +src_common_linux_scoped_tmpfile_unittest_LDADD = \ + src/common/linux/scoped_tmpfile.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) src_processor_disassembler_objdump_unittest_SOURCES = \ src/processor/disassembler_objdump_unittest.cc src_processor_disassembler_objdump_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) src_processor_disassembler_objdump_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -1033,6 +1072,12 @@ src_processor_microdump_processor_unittest_LDADD = \ src/processor/tokenize.o \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_microdump_processor_unittest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif src_processor_minidump_processor_unittest_SOURCES = \ src/processor/minidump_processor_unittest.cc @@ -1044,7 +1089,6 @@ src_processor_minidump_processor_unittest_LDADD = \ src/processor/call_stack.o \ src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -1077,6 +1121,12 @@ src_processor_minidump_processor_unittest_LDADD = \ src/third_party/libdisasm/libdisasm.a \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_minidump_processor_unittest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif src_processor_minidump_unittest_SOURCES = \ src/common/test_assembler.cc \ @@ -1194,7 +1244,6 @@ 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_objdump.o \ src/processor/disassembler_x86.o \ src/processor/exploitability.o \ src/processor/exploitability_linux.o \ @@ -1220,6 +1269,12 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/stackwalker_x86.o \ src/processor/tokenize.o \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +if LINUX_HOST +src_processor_stackwalker_selftest_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif src_processor_stackwalker_amd64_unittest_SOURCES = \ src/common/test_assembler.cc \ @@ -1406,6 +1461,12 @@ src_processor_microdump_stackwalk_LDADD = \ src/processor/stackwalker_x86.o \ src/processor/tokenize.o \ src/third_party/libdisasm/libdisasm.a +if LINUX_HOST +src_processor_microdump_stackwalk_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif src_processor_minidump_stackwalk_SOURCES = \ src/processor/minidump_stackwalk.cc @@ -1416,7 +1477,6 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/call_stack.o \ src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ src/processor/disassembler_x86.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -1449,6 +1509,12 @@ src_processor_minidump_stackwalk_LDADD = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o \ src/third_party/libdisasm/libdisasm.a +if LINUX_HOST +src_processor_minidump_stackwalk_LDADD += \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ + src/processor/disassembler_objdump.o +endif LINUX_HOST ## Additional files to be included in a source distribution ## diff --git a/Makefile.in b/Makefile.in index 17a453517..d790cac43 100644 --- a/Makefile.in +++ b/Makefile.in @@ -131,11 +131,11 @@ host_triplet = @host@ # Build as PIC on Linux, for linux_client_unittest_shlib @LINUX_HOST_TRUE@am__append_2 = -fPIC @LINUX_HOST_TRUE@am__append_3 = -fPIC -libexec_PROGRAMS = $(am__EXEEXT_10) +libexec_PROGRAMS = $(am__EXEEXT_11) bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) check_PROGRAMS = src/common/safe_math_unittest$(EXEEXT) \ $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ - $(am__EXEEXT_8) $(am__EXEEXT_9) + $(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) noinst_PROGRAMS = EXTRA_PROGRAMS = $(am__EXEEXT_1) @@ -164,7 +164,6 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @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_objdump_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 \ @@ -193,7 +192,12 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest -@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_10 = \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__append_10 = \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/processor/disassembler_objdump_unittest \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe_unittest \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile_unittest + +@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_11 = \ @DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest @@ -203,17 +207,17 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) # Currently Linux only, the macOS client # is built using an Xcode project instead. # -@LINUX_HOST_TRUE@am__append_11 = src/client/linux/libbreakpad_client.a -@LINUX_HOST_TRUE@am__append_12 = breakpad-client.pc -@LINUX_HOST_TRUE@am__append_13 = \ +@LINUX_HOST_TRUE@am__append_12 = src/client/linux/libbreakpad_client.a +@LINUX_HOST_TRUE@am__append_13 = breakpad-client.pc +@LINUX_HOST_TRUE@am__append_14 = \ @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest \ @LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test -@LINUX_HOST_TRUE@am__append_14 = \ +@LINUX_HOST_TRUE@am__append_15 = \ @LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \ @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib -@LINUX_HOST_TRUE@am__append_15 = \ +@LINUX_HOST_TRUE@am__append_16 = \ @LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \ @LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib @@ -222,7 +226,7 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) # Various Breakpad tools # This includes symbol dumpers and uploaders # -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_16 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_17 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/pid2md/pid2md \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms \ @@ -230,31 +234,69 @@ EXTRA_PROGRAMS = $(am__EXEEXT_1) @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_17 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_18 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__append_18 = \ +@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__append_19 = \ @DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@ src/tools/linux/core_handler/core_handler -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_19 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_20 = \ @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_20 = \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_21 = \ @DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/common/mac/macho_reader_unittest -@HAVE_GETCONTEXT_FALSE@am__append_21 = \ +@LINUX_HOST_TRUE@am__append_22 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.h \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.cc \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.h \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.cc \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.h \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.cc + +@HAVE_GETCONTEXT_FALSE@am__append_23 = \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext.S -@HAVE_GETCONTEXT_FALSE@am__append_22 = \ +@HAVE_GETCONTEXT_FALSE@am__append_24 = \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext.S \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/breakpad_getcontext_unittest.cc -@ANDROID_HOST_TRUE@am__append_23 = \ +@ANDROID_HOST_TRUE@am__append_25 = \ @ANDROID_HOST_TRUE@ -llog -lm -@ANDROID_HOST_TRUE@am__append_24 = \ +@ANDROID_HOST_TRUE@am__append_26 = \ @ANDROID_HOST_TRUE@ -llog +@LINUX_HOST_TRUE@am__append_27 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_28 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_29 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_30 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_31 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + +@LINUX_HOST_TRUE@am__append_32 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.o \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.o \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.o + subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ @@ -306,7 +348,6 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @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_objdump_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) \ @@ -334,13 +375,16 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_riscv64_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \ @DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT) -@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_6 = src/processor/stackwalker_selftest$(EXEEXT) -@LINUX_HOST_TRUE@am__EXEEXT_7 = src/client/linux/linux_client_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_6 = src/processor/disassembler_objdump_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe_unittest$(EXEEXT) \ +@DISABLE_PROCESSOR_FALSE@@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile_unittest$(EXEEXT) +@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_7 = src/processor/stackwalker_selftest$(EXEEXT) +@LINUX_HOST_TRUE@am__EXEEXT_8 = src/client/linux/linux_client_unittest$(EXEEXT) \ @LINUX_HOST_TRUE@ src/common/linux/google_crashdump_uploader_test$(EXEEXT) -@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_8 = src/common/dumper_unittest$(EXEEXT) \ +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_9 = 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_9 = src/common/mac/macho_reader_unittest$(EXEEXT) -@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__EXEEXT_10 = src/tools/linux/core_handler/core_handler$(EXEEXT) +@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_10 = src/common/mac/macho_reader_unittest$(EXEEXT) +@DISABLE_TOOLS_FALSE@@HAVE_MEMFD_CREATE_TRUE@@LINUX_HOST_TRUE@am__EXEEXT_11 = src/tools/linux/core_handler/core_handler$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -436,13 +480,132 @@ 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/convert_old_arm64_context.cc \ + src/processor/convert_old_arm64_context.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/stackwalk_common.cc \ + src/processor/stackwalk_common.h 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_riscv.cc \ + src/processor/stackwalker_riscv.h \ + src/processor/stackwalker_riscv64.cc \ + src/processor/stackwalker_riscv64.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/common/linux/scoped_pipe.h src/common/linux/scoped_pipe.cc \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ + src/processor/disassembler_objdump.h \ + src/processor/disassembler_objdump.cc +@LINUX_HOST_TRUE@am__objects_2 = \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_pipe.$(OBJEXT) \ +@LINUX_HOST_TRUE@ src/common/linux/scoped_tmpfile.$(OBJEXT) \ +@LINUX_HOST_TRUE@ src/processor/disassembler_objdump.$(OBJEXT) am_src_libbreakpad_a_OBJECTS = \ src/processor/basic_code_modules.$(OBJEXT) \ src/processor/basic_source_line_resolver.$(OBJEXT) \ src/processor/call_stack.$(OBJEXT) \ src/processor/cfi_frame_info.$(OBJEXT) \ src/processor/convert_old_arm64_context.$(OBJEXT) \ - src/processor/disassembler_objdump.$(OBJEXT) \ src/processor/disassembler_x86.$(OBJEXT) \ src/processor/dump_context.$(OBJEXT) \ src/processor/dump_object.$(OBJEXT) \ @@ -478,14 +641,18 @@ am_src_libbreakpad_a_OBJECTS = \ src/processor/stackwalker_sparc.$(OBJEXT) \ src/processor/stackwalker_x86.$(OBJEXT) \ src/processor/symbolic_constants_win.$(OBJEXT) \ - src/processor/tokenize.$(OBJEXT) + src/processor/tokenize.$(OBJEXT) $(am__objects_2) 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_OBJECTS = \ - src/testing/googletest/src/libtesting_a-gtest-all.$(OBJEXT) \ - src/testing/googletest/src/libtesting_a-gtest_main.$(OBJEXT) \ - src/testing/googlemock/src/libtesting_a-gmock-all.$(OBJEXT) +am__src_testing_libtesting_a_SOURCES_DIST = \ + src/breakpad_googletest_includes.h \ + src/testing/googletest/src/gtest-all.cc \ + src/testing/googletest/src/gtest_main.cc \ + src/testing/googlemock/src/gmock-all.cc +@SYSTEM_TEST_LIBS_FALSE@am_src_testing_libtesting_a_OBJECTS = src/testing/googletest/src/libtesting_a-gtest-all.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/libtesting_a-gtest_main.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/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) @@ -536,7 +703,9 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ 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/scoped_pipe.h src/common/linux/scoped_pipe.cc \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ src/common/memory_allocator_unittest.cc \ src/common/tests/auto_tempdir.h src/common/tests/file_utils.cc \ @@ -549,13 +718,13 @@ am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \ src/processor/proc_maps_linux.cc \ src/common/linux/breakpad_getcontext.S \ src/common/linux/breakpad_getcontext_unittest.cc -am__objects_2 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ - src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \ - src/testing/googlemock/src/client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) -@HAVE_GETCONTEXT_FALSE@am__objects_3 = src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@am__objects_3 = src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT) +@HAVE_GETCONTEXT_FALSE@am__objects_4 = src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT) \ @HAVE_GETCONTEXT_FALSE@ src/common/linux/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT) am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ - $(am__objects_2) \ + $(am__objects_3) \ src/client/linux/handler/linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \ src/client/linux/microdump_writer/linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \ src/client/linux/minidump_writer/linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT) \ @@ -570,6 +739,8 @@ am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ src/client/linux/minidump_writer/linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \ + src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.$(OBJEXT) \ + src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.$(OBJEXT) \ src/common/linux/tests/client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \ src/common/client_linux_linux_client_unittest_shlib-memory_allocator_unittest.$(OBJEXT) \ src/common/tests/client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT) \ @@ -581,7 +752,7 @@ am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \ src/processor/client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT) \ src/processor/client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT) \ src/processor/client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT) \ - $(am__objects_3) + $(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) \ @@ -673,6 +844,18 @@ src_common_linux_google_crashdump_uploader_test_OBJECTS = \ src_common_linux_google_crashdump_uploader_test_DEPENDENCIES = \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) +am_src_common_linux_scoped_pipe_unittest_OBJECTS = src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.$(OBJEXT) +src_common_linux_scoped_pipe_unittest_OBJECTS = \ + $(am_src_common_linux_scoped_pipe_unittest_OBJECTS) +src_common_linux_scoped_pipe_unittest_DEPENDENCIES = \ + src/common/linux/scoped_pipe.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_src_common_linux_scoped_tmpfile_unittest_OBJECTS = src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.$(OBJEXT) +src_common_linux_scoped_tmpfile_unittest_OBJECTS = \ + $(am_src_common_linux_scoped_tmpfile_unittest_OBJECTS) +src_common_linux_scoped_tmpfile_unittest_DEPENDENCIES = \ + src/common/linux/scoped_tmpfile.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_src_common_mac_macho_reader_unittest_OBJECTS = src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT) \ src/common/mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT) \ src/common/mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT) \ @@ -747,6 +930,8 @@ am_src_processor_disassembler_objdump_unittest_OBJECTS = src/processor/disassemb src_processor_disassembler_objdump_unittest_OBJECTS = \ $(am_src_processor_disassembler_objdump_unittest_OBJECTS) src_processor_disassembler_objdump_unittest_DEPENDENCIES = \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o \ src/processor/dump_context.o src/processor/dump_object.o \ src/processor/logging.o src/processor/pathname_stripper.o \ @@ -765,9 +950,7 @@ src_processor_exploitability_unittest_OBJECTS = \ src_processor_exploitability_unittest_DEPENDENCIES = \ src/processor/convert_old_arm64_context.o \ src/processor/minidump_processor.o \ - src/processor/process_state.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.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 \ @@ -797,7 +980,7 @@ src_processor_exploitability_unittest_DEPENDENCIES = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__append_27) am_src_processor_fast_source_line_resolver_unittest_OBJECTS = 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) src_processor_fast_source_line_resolver_unittest_DEPENDENCIES = \ @@ -845,7 +1028,7 @@ src_processor_microdump_processor_unittest_DEPENDENCIES = \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__append_28) am_src_processor_microdump_stackwalk_OBJECTS = \ src/processor/microdump_stackwalk.$(OBJEXT) src_processor_microdump_stackwalk_OBJECTS = \ @@ -877,7 +1060,7 @@ src_processor_microdump_stackwalk_DEPENDENCIES = \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ - src/third_party/libdisasm/libdisasm.a + src/third_party/libdisasm/libdisasm.a $(am__append_31) am_src_processor_minidump_dump_OBJECTS = \ src/processor/minidump_dump.$(OBJEXT) src_processor_minidump_dump_OBJECTS = \ @@ -897,7 +1080,6 @@ src_processor_minidump_processor_unittest_DEPENDENCIES = \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.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 \ @@ -923,7 +1105,7 @@ src_processor_minidump_processor_unittest_DEPENDENCIES = \ src/processor/symbolic_constants_win.o \ src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__append_29) am_src_processor_minidump_stackwalk_OBJECTS = \ src/processor/minidump_stackwalk.$(OBJEXT) src_processor_minidump_stackwalk_OBJECTS = \ @@ -933,7 +1115,6 @@ src_processor_minidump_stackwalk_DEPENDENCIES = \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.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 \ @@ -958,7 +1139,8 @@ src_processor_minidump_stackwalk_DEPENDENCIES = \ 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 + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(am__append_32) am_src_processor_minidump_unittest_OBJECTS = src/common/processor_minidump_unittest-test_assembler.$(OBJEXT) \ src/processor/minidump_unittest-minidump_unittest.$(OBJEXT) \ src/processor/minidump_unittest-synth_minidump.$(OBJEXT) @@ -1078,9 +1260,7 @@ src_processor_stackwalker_selftest_OBJECTS = \ src_processor_stackwalker_selftest_DEPENDENCIES = \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ - src/processor/call_stack.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.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 \ @@ -1101,7 +1281,7 @@ src_processor_stackwalker_selftest_DEPENDENCIES = \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ src/processor/stackwalker_x86.o src/processor/tokenize.o \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_30) am_src_processor_stackwalker_x86_unittest_OBJECTS = src/common/processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT) \ src/processor/stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT) src_processor_stackwalker_x86_unittest_OBJECTS = \ @@ -1390,6 +1570,8 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po \ src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po \ + src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po \ + src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po \ src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po \ @@ -1419,6 +1601,10 @@ am__depfiles_remade = src/client/$(DEPDIR)/minidump_file_writer.Po \ src/common/linux/$(DEPDIR)/linux_libc_support.Po \ src/common/linux/$(DEPDIR)/memory_mapped_file.Po \ src/common/linux/$(DEPDIR)/safe_readlink.Po \ + src/common/linux/$(DEPDIR)/scoped_pipe.Po \ + src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po \ + src/common/linux/$(DEPDIR)/scoped_tmpfile.Po \ + src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po \ src/common/linux/$(DEPDIR)/symbol_collector_client.Po \ src/common/linux/$(DEPDIR)/symbol_upload.Po \ src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po \ @@ -1613,6 +1799,8 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES) \ $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ + $(src_common_linux_scoped_pipe_unittest_SOURCES) \ + $(src_common_linux_scoped_tmpfile_unittest_SOURCES) \ $(src_common_mac_macho_reader_unittest_SOURCES) \ $(src_common_safe_math_unittest_SOURCES) \ $(src_common_test_assembler_unittest_SOURCES) \ @@ -1663,8 +1851,8 @@ SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \ $(src_tools_mac_dump_syms_dump_syms_mac_SOURCES) DIST_SOURCES = \ $(am__src_client_linux_libbreakpad_client_a_SOURCES_DIST) \ - $(src_libbreakpad_a_SOURCES) \ - $(src_testing_libtesting_a_SOURCES) \ + $(am__src_libbreakpad_a_SOURCES_DIST) \ + $(am__src_testing_libtesting_a_SOURCES_DIST) \ $(src_third_party_libdisasm_libdisasm_a_SOURCES) \ $(src_client_linux_linux_client_unittest_SOURCES) \ $(am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST) \ @@ -1673,6 +1861,8 @@ DIST_SOURCES = \ $(src_common_dwarf_dwarf2reader_lineinfo_unittest_SOURCES) \ $(src_common_dwarf_dwarf2reader_splitfunctions_unittest_SOURCES) \ $(src_common_linux_google_crashdump_uploader_test_SOURCES) \ + $(src_common_linux_scoped_pipe_unittest_SOURCES) \ + $(src_common_linux_scoped_tmpfile_unittest_SOURCES) \ $(src_common_mac_macho_reader_unittest_SOURCES) \ $(src_common_safe_math_unittest_SOURCES) \ $(src_common_test_assembler_unittest_SOURCES) \ @@ -2128,7 +2318,7 @@ 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_12) +pkgconfig_DATA = $(am__append_6) $(am__append_13) @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/googletest/include \ @@ -2152,17 +2342,17 @@ pkgconfig_DATA = $(am__append_6) $(am__append_12) @ANDROID_HOST_TRUE@LOG_DRIVER = $(top_srcdir)/android/test-driver check_LIBRARIES = $(am__append_4) noinst_LIBRARIES = $(am__append_7) -lib_LIBRARIES = $(am__append_5) $(am__append_11) +lib_LIBRARIES = $(am__append_5) $(am__append_12) noinst_SCRIPTS = $(check_SCRIPTS) -CLEANFILES = $(am__append_15) -src_testing_libtesting_a_SOURCES = \ - src/breakpad_googletest_includes.h \ - src/testing/googletest/src/gtest-all.cc \ - src/testing/googletest/src/gtest_main.cc \ - src/testing/googlemock/src/gmock-all.cc +CLEANFILES = $(am__append_16) +@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_SOURCES = \ +@SYSTEM_TEST_LIBS_FALSE@ src/breakpad_googletest_includes.h \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest-all.cc \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googletest/src/gtest_main.cc \ +@SYSTEM_TEST_LIBS_FALSE@ src/testing/googlemock/src/gmock-all.cc -src_testing_libtesting_a_CPPFLAGS = \ - $(AM_CPPFLAGS) $(TEST_CFLAGS) +@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_CPPFLAGS = \ +@SYSTEM_TEST_LIBS_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) @DISABLE_PROCESSOR_FALSE@check_SCRIPTS = \ @DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_test \ @@ -2192,7 +2382,7 @@ src_common_safe_math_unittest_LDADD = \ # Breakpad processor library -src_libbreakpad_a_SOURCES = \ +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 \ @@ -2220,26 +2410,21 @@ src_libbreakpad_a_SOURCES = \ 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/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/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/convert_old_arm64_context.cc \ src/processor/convert_old_arm64_context.h \ - src/processor/disassembler_objdump.h \ - src/processor/disassembler_objdump.cc \ src/processor/disassembler_x86.h \ src/processor/disassembler_x86.cc \ - src/processor/dump_context.cc \ - src/processor/dump_object.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 \ @@ -2247,18 +2432,13 @@ src_libbreakpad_a_SOURCES = \ 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/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_comparer.h src/processor/module_factory.h \ src/processor/module_serializer.cc \ src/processor/module_serializer.h \ src/processor/pathname_stripper.cc \ @@ -2266,8 +2446,7 @@ src_libbreakpad_a_SOURCES = \ 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/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 \ @@ -2279,8 +2458,7 @@ src_libbreakpad_a_SOURCES = \ src/processor/stack_frame_cpu.cc \ src/processor/stack_frame_symbolizer.cc \ src/processor/stackwalk_common.cc \ - src/processor/stackwalk_common.h \ - src/processor/stackwalker.cc \ + src/processor/stackwalk_common.h src/processor/stackwalker.cc \ src/processor/stackwalker_amd64.cc \ src/processor/stackwalker_amd64.h \ src/processor/stackwalker_arm.cc \ @@ -2309,15 +2487,13 @@ src_libbreakpad_a_SOURCES = \ 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_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/processor/tokenize.cc src/processor/tokenize.h \ + $(am__append_22) # libdisasm 3rd party library src_third_party_libdisasm_libdisasm_a_SOURCES = \ @@ -2378,7 +2554,7 @@ src_client_linux_libbreakpad_client_a_SOURCES = \ 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 $(am__append_21) + src/common/linux/safe_readlink.cc $(am__append_23) # Client tests src_client_linux_linux_dumper_unittest_helper_SOURCES = \ @@ -2406,7 +2582,9 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ 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/scoped_pipe.h src/common/linux/scoped_pipe.cc \ + src/common/linux/scoped_tmpfile.h \ + src/common/linux/scoped_tmpfile.cc \ src/common/linux/tests/crash_generator.cc \ src/common/memory_allocator_unittest.cc \ src/common/tests/auto_tempdir.h src/common/tests/file_utils.cc \ @@ -2416,12 +2594,12 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \ 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 $(am__append_22) + src/processor/proc_maps_linux.cc $(am__append_24) 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 $(am__append_23) + -Wl,-h,linux_client_unittest_shlib $(am__append_25) 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 \ @@ -2457,7 +2635,7 @@ src_client_linux_linux_client_unittest_SOURCES = src_client_linux_linux_client_unittest_LDFLAGS = \ -Wl,-rpath,'$$ORIGIN' \ -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f \ - $(am__append_24) + $(am__append_26) src_client_linux_linux_client_unittest_LDADD = \ src/client/linux/linux_client_unittest_shlib \ $(TEST_LIBS) @@ -2761,23 +2939,18 @@ src_processor_exploitability_unittest_SOURCES = \ src_processor_exploitability_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) -src_processor_exploitability_unittest_LDADD = \ +src_processor_exploitability_unittest_LDADD = \ src/processor/convert_old_arm64_context.o \ src/processor/minidump_processor.o \ - src/processor/process_state.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.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/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 \ @@ -2797,8 +2970,28 @@ src_processor_exploitability_unittest_LDADD = \ 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 \ + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + $(am__append_27) +src_common_linux_scoped_pipe_unittest_SOURCES = \ + src/common/linux/scoped_pipe_unittest.cc + +src_common_linux_scoped_pipe_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_linux_scoped_pipe_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + $(TEST_LIBS) \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +src_common_linux_scoped_tmpfile_unittest_SOURCES = \ + src/common/linux/scoped_tmpfile_unittest.cc + +src_common_linux_scoped_tmpfile_unittest_CPPFLAGS = \ + $(AM_CPPFLAGS) $(TEST_CFLAGS) + +src_common_linux_scoped_tmpfile_unittest_LDADD = \ + src/common/linux/scoped_tmpfile.o \ $(TEST_LIBS) \ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) @@ -2809,6 +3002,8 @@ src_processor_disassembler_objdump_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) src_processor_disassembler_objdump_unittest_LDADD = \ + src/common/linux/scoped_pipe.o \ + src/common/linux/scoped_tmpfile.o \ src/processor/disassembler_objdump.o \ src/processor/dump_context.o \ src/processor/dump_object.o \ @@ -2866,17 +3061,14 @@ src_processor_microdump_processor_unittest_SOURCES = \ src_processor_microdump_processor_unittest_CPPFLAGS = \ $(AM_CPPFLAGS) $(TEST_CFLAGS) -src_processor_microdump_processor_unittest_LDADD = \ +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/convert_old_arm64_context.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/convert_old_arm64_context.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 \ @@ -2893,36 +3085,27 @@ src_processor_microdump_processor_unittest_LDADD = \ src/processor/stackwalker_riscv.o \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ - src/processor/stackwalker_x86.o \ - src/processor/tokenize.o \ - $(TEST_LIBS) \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + $(am__append_28) 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_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/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ - src/processor/dump_context.o \ - src/processor/dump_object.o \ - src/processor/exploitability.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/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/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 \ @@ -2939,11 +3122,9 @@ src_processor_minidump_processor_unittest_LDADD = \ 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/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(TEST_LIBS) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \ + $(am__append_29) src_processor_minidump_unittest_SOURCES = \ src/common/test_assembler.cc \ src/processor/minidump_unittest.cc \ @@ -3076,18 +3257,14 @@ src_processor_range_map_unittest_LDADD = \ src_processor_stackwalker_selftest_SOURCES = \ src/processor/stackwalker_selftest.cc -src_processor_stackwalker_selftest_LDADD = \ +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_objdump.o \ - src/processor/disassembler_x86.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/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 \ @@ -3103,10 +3280,8 @@ src_processor_stackwalker_selftest_LDADD = \ src/processor/stackwalker_riscv.o \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ - src/processor/stackwalker_x86.o \ - src/processor/tokenize.o \ - $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) - + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(am__append_30) src_processor_stackwalker_amd64_unittest_SOURCES = \ src/common/test_assembler.cc \ src/processor/stackwalker_amd64_unittest.cc @@ -3286,27 +3461,22 @@ src_processor_minidump_dump_LDADD = \ src_processor_microdump_stackwalk_SOURCES = \ src/processor/microdump_stackwalk.cc -src_processor_microdump_stackwalk_LDADD = \ - src/common/path_helper.o \ +src_processor_microdump_stackwalk_LDADD = src/common/path_helper.o \ src/processor/basic_code_modules.o \ src/processor/basic_source_line_resolver.o \ src/processor/call_stack.o \ src/processor/convert_old_arm64_context.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/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/stackwalk_common.o src/processor/stackwalker.o \ src/processor/stackwalker_address_list.o \ src/processor/stackwalker_amd64.o \ src/processor/stackwalker_arm.o \ @@ -3317,39 +3487,28 @@ src_processor_microdump_stackwalk_LDADD = \ src/processor/stackwalker_riscv.o \ src/processor/stackwalker_riscv64.o \ src/processor/stackwalker_sparc.o \ - src/processor/stackwalker_x86.o \ - src/processor/tokenize.o \ - src/third_party/libdisasm/libdisasm.a - + src/processor/stackwalker_x86.o src/processor/tokenize.o \ + src/third_party/libdisasm/libdisasm.a $(am__append_31) src_processor_minidump_stackwalk_SOURCES = \ src/processor/minidump_stackwalk.cc -src_processor_minidump_stackwalk_LDADD = \ - src/common/path_helper.o \ +src_processor_minidump_stackwalk_LDADD = src/common/path_helper.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/call_stack.o src/processor/cfi_frame_info.o \ src/processor/convert_old_arm64_context.o \ - src/processor/disassembler_objdump.o \ - src/processor/disassembler_x86.o \ - src/processor/dump_context.o \ - src/processor/dump_object.o \ - src/processor/exploitability.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/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/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/stackwalk_common.o src/processor/stackwalker.o \ src/processor/stackwalker_address_list.o \ src/processor/stackwalker_amd64.o \ src/processor/stackwalker_arm.o \ @@ -3362,9 +3521,8 @@ src_processor_minidump_stackwalk_LDADD = \ 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 - + src/processor/tokenize.o src/third_party/libdisasm/libdisasm.a \ + $(am__append_32) EXTRA_DIST = \ $(SCRIPTS) \ src/client/linux/data/linux-gate-amd.sym \ @@ -3961,9 +4119,6 @@ src/processor/cfi_frame_info.$(OBJEXT): src/processor/$(am__dirstamp) \ src/processor/convert_old_arm64_context.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) -src/processor/disassembler_objdump.$(OBJEXT): \ - src/processor/$(am__dirstamp) \ - src/processor/$(DEPDIR)/$(am__dirstamp) src/processor/disassembler_x86.$(OBJEXT): \ src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) @@ -4063,6 +4218,15 @@ src/processor/symbolic_constants_win.$(OBJEXT): \ src/processor/$(DEPDIR)/$(am__dirstamp) src/processor/tokenize.$(OBJEXT): src/processor/$(am__dirstamp) \ src/processor/$(DEPDIR)/$(am__dirstamp) +src/common/linux/scoped_pipe.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) +src/common/linux/scoped_tmpfile.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) +src/processor/disassembler_objdump.$(OBJEXT): \ + src/processor/$(am__dirstamp) \ + src/processor/$(DEPDIR)/$(am__dirstamp) src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) @@ -4208,6 +4372,12 @@ src/common/linux/client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT src/common/linux/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/client_linux_linux_client_unittest_shlib-scoped_pipe.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.$(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) @@ -4454,6 +4624,20 @@ src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.$(OBJEXT): \ src/common/linux/google_crashdump_uploader_test$(EXEEXT): $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) $(EXTRA_src_common_linux_google_crashdump_uploader_test_DEPENDENCIES) src/common/linux/$(am__dirstamp) @rm -f src/common/linux/google_crashdump_uploader_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_google_crashdump_uploader_test_OBJECTS) $(src_common_linux_google_crashdump_uploader_test_LDADD) $(LIBS) +src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) + +src/common/linux/scoped_pipe_unittest$(EXEEXT): $(src_common_linux_scoped_pipe_unittest_OBJECTS) $(src_common_linux_scoped_pipe_unittest_DEPENDENCIES) $(EXTRA_src_common_linux_scoped_pipe_unittest_DEPENDENCIES) src/common/linux/$(am__dirstamp) + @rm -f src/common/linux/scoped_pipe_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_scoped_pipe_unittest_OBJECTS) $(src_common_linux_scoped_pipe_unittest_LDADD) $(LIBS) +src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.$(OBJEXT): \ + src/common/linux/$(am__dirstamp) \ + src/common/linux/$(DEPDIR)/$(am__dirstamp) + +src/common/linux/scoped_tmpfile_unittest$(EXEEXT): $(src_common_linux_scoped_tmpfile_unittest_OBJECTS) $(src_common_linux_scoped_tmpfile_unittest_DEPENDENCIES) $(EXTRA_src_common_linux_scoped_tmpfile_unittest_DEPENDENCIES) src/common/linux/$(am__dirstamp) + @rm -f src/common/linux/scoped_tmpfile_unittest$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(src_common_linux_scoped_tmpfile_unittest_OBJECTS) $(src_common_linux_scoped_tmpfile_unittest_LDADD) $(LIBS) src/common/mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT): \ src/common/$(am__dirstamp) \ src/common/$(DEPDIR)/$(am__dirstamp) @@ -5244,6 +5428,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po@am__quote@ # am--include-marker @@ -5273,6 +5459,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/linux_libc_support.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/memory_mapped_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/safe_readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_tmpfile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_collector_client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_upload.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po@am__quote@ # am--include-marker @@ -5769,6 +5959,34 @@ src/common/linux/client_linux_linux_client_unittest_shlib-linux_libc_support_uni @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/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/client_linux_linux_client_unittest_shlib-scoped_pipe.o: src/common/linux/scoped_pipe.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/client_linux_linux_client_unittest_shlib-scoped_pipe.o -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.o `test -f 'src/common/linux/scoped_pipe.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.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/client_linux_linux_client_unittest_shlib-scoped_pipe.o `test -f 'src/common/linux/scoped_pipe.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe.cc + +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.obj: src/common/linux/scoped_pipe.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/client_linux_linux_client_unittest_shlib-scoped_pipe.obj -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.obj `if test -f 'src/common/linux/scoped_pipe.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_pipe.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/client_linux_linux_client_unittest_shlib-scoped_pipe.obj `if test -f 'src/common/linux/scoped_pipe.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe.cc'; fi` + +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o: src/common/linux/scoped_tmpfile.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/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o `test -f 'src/common/linux/scoped_tmpfile.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.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/client_linux_linux_client_unittest_shlib-scoped_tmpfile.o `test -f 'src/common/linux/scoped_tmpfile.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile.cc + +src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj: src/common/linux/scoped_tmpfile.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/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj -MD -MP -MF src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo -c -o src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj `if test -f 'src/common/linux/scoped_tmpfile.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Tpo src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile.cc' object='src/common/linux/client_linux_linux_client_unittest_shlib-scoped_tmpfile.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/client_linux_linux_client_unittest_shlib-scoped_tmpfile.obj `if test -f 'src/common/linux/scoped_tmpfile.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile.cc'; fi` + src/common/linux/tests/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/client_linux_linux_client_unittest_shlib-crash_generator.o -MD -MP -MF src/common/linux/tests/$(DEPDIR)/client_linux_linux_client_unittest_shlib-crash_generator.Tpo -c -o src/common/linux/tests/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)/client_linux_linux_client_unittest_shlib-crash_generator.Tpo src/common/linux/tests/$(DEPDIR)/client_linux_linux_client_unittest_shlib-crash_generator.Po @@ -6707,6 +6925,34 @@ src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.obj: src/common/ @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_linux_google_crashdump_uploader_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/google_crashdump_uploader_test-libcurl_wrapper.obj `if test -f 'src/common/linux/libcurl_wrapper.cc'; then $(CYGPATH_W) 'src/common/linux/libcurl_wrapper.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/libcurl_wrapper.cc'; fi` +src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o: src/common/linux/scoped_pipe_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o `test -f 'src/common/linux/scoped_pipe_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe_unittest.cc' object='src/common/linux/scoped_pipe_unittest-scoped_pipe_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_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.o `test -f 'src/common/linux/scoped_pipe_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_pipe_unittest.cc + +src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj: src/common/linux/scoped_pipe_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj `if test -f 'src/common/linux/scoped_pipe_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_pipe_unittest.cc' object='src/common/linux/scoped_pipe_unittest-scoped_pipe_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_linux_scoped_pipe_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_pipe_unittest-scoped_pipe_unittest.obj `if test -f 'src/common/linux/scoped_pipe_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_pipe_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_pipe_unittest.cc'; fi` + +src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o: src/common/linux/scoped_tmpfile_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o `test -f 'src/common/linux/scoped_tmpfile_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile_unittest.cc' object='src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_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_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.o `test -f 'src/common/linux/scoped_tmpfile_unittest.cc' || echo '$(srcdir)/'`src/common/linux/scoped_tmpfile_unittest.cc + +src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj: src/common/linux/scoped_tmpfile_unittest.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj `if test -f 'src/common/linux/scoped_tmpfile_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile_unittest.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Tpo src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/scoped_tmpfile_unittest.cc' object='src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_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_linux_scoped_tmpfile_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/scoped_tmpfile_unittest-scoped_tmpfile_unittest.obj `if test -f 'src/common/linux/scoped_tmpfile_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/scoped_tmpfile_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/scoped_tmpfile_unittest.cc'; fi` + 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/mac_macho_reader_unittest-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo -c -o 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)/mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/mac_macho_reader_unittest-dwarf_cfi_to_module.Po @@ -8762,13 +9008,6 @@ src/processor/contained_range_map_unittest.log: src/processor/contained_range_ma --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_objdump_unittest.log: src/processor/disassembler_objdump_unittest$(EXEEXT) - @p='src/processor/disassembler_objdump_unittest$(EXEEXT)'; \ - b='src/processor/disassembler_objdump_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'; \ @@ -8958,6 +9197,27 @@ src/processor/synth_minidump_unittest.log: src/processor/synth_minidump_unittest --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_objdump_unittest.log: src/processor/disassembler_objdump_unittest$(EXEEXT) + @p='src/processor/disassembler_objdump_unittest$(EXEEXT)'; \ + b='src/processor/disassembler_objdump_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/linux/scoped_pipe_unittest.log: src/common/linux/scoped_pipe_unittest$(EXEEXT) + @p='src/common/linux/scoped_pipe_unittest$(EXEEXT)'; \ + b='src/common/linux/scoped_pipe_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/linux/scoped_tmpfile_unittest.log: src/common/linux/scoped_tmpfile_unittest$(EXEEXT) + @p='src/common/linux/scoped_tmpfile_unittest$(EXEEXT)'; \ + b='src/common/linux/scoped_tmpfile_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'; \ @@ -9450,6 +9710,8 @@ distclean: distclean-am -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po @@ -9479,6 +9741,10 @@ distclean: distclean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po -rm -f src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po @@ -9804,6 +10070,8 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-elf_core_dump.Po -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_pipe.Po + -rm -f src/common/linux/$(DEPDIR)/client_linux_linux_client_unittest_shlib-scoped_tmpfile.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-crc32.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols.Po -rm -f src/common/linux/$(DEPDIR)/dumper_unittest-dump_symbols_unittest.Po @@ -9833,6 +10101,10 @@ maintainer-clean: maintainer-clean-am -rm -f src/common/linux/$(DEPDIR)/linux_libc_support.Po -rm -f src/common/linux/$(DEPDIR)/memory_mapped_file.Po -rm -f src/common/linux/$(DEPDIR)/safe_readlink.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_pipe_unittest-scoped_pipe_unittest.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile.Po + -rm -f src/common/linux/$(DEPDIR)/scoped_tmpfile_unittest-scoped_tmpfile_unittest.Po -rm -f src/common/linux/$(DEPDIR)/symbol_collector_client.Po -rm -f src/common/linux/$(DEPDIR)/symbol_upload.Po -rm -f src/common/linux/$(DEPDIR)/tools_linux_dump_syms_dump_syms-crc32.Po diff --git a/configure b/configure index d131f5a91..76d4a9f61 100755 --- a/configure +++ b/configure @@ -7748,10 +7748,1647 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5 +printf %s "checking whether $CXX supports C++17 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx17+y} +then : + printf %s "(cached) " >&6 +else $as_nop + 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" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> 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 + { + 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::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::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 + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::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 + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_cxx_compile_cxx17=yes +else $as_nop + ax_cv_cxx_compile_cxx17=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx17" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx17" >&6; } + if test x$ax_cv_cxx_compile_cxx17 = xyes; then + ac_success=yes + fi + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $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" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> 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 + { + 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::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::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 + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::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 + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi + if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do diff --git a/configure.ac b/configure.ac index 69e23545f..ca2936695 100644 --- a/configure.ac +++ b/configure.ac @@ -75,7 +75,7 @@ AC_CHECK_FUNCS([arc4random getcontext getrandom memfd_create]) AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes]) AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$ac_cv_func_memfd_create" = xyes]) -AX_CXX_COMPILE_STDCXX(17, noext, mandatory) +AX_CXX_COMPILE_STDCXX(17, , mandatory) dnl Test supported warning flags. WARN_CXXFLAGS= diff --git a/src/client/linux/minidump_writer/cpu_set_unittest.cc b/src/client/linux/minidump_writer/cpu_set_unittest.cc index 1db74410d..e9d4e87ac 100644 --- a/src/client/linux/minidump_writer/cpu_set_unittest.cc +++ b/src/client/linux/minidump_writer/cpu_set_unittest.cc @@ -35,7 +35,7 @@ #include "breakpad_googletest_includes.h" #include "client/linux/minidump_writer/cpu_set.h" -#include "common/linux/tests/auto_testfile.h" +#include "common/linux/scoped_tmpfile.h" using namespace google_breakpad; @@ -43,15 +43,6 @@ 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) { @@ -60,8 +51,8 @@ TEST(CpuSetTest, EmptyCount) { } TEST(CpuSetTest, OneCpu) { - ScopedTestFile file("10"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("10")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -69,8 +60,8 @@ TEST(CpuSetTest, OneCpu) { } TEST(CpuSetTest, OneCpuTerminated) { - ScopedTestFile file("10\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("10\n")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -78,8 +69,8 @@ TEST(CpuSetTest, OneCpuTerminated) { } TEST(CpuSetTest, TwoCpusWithComma) { - ScopedTestFile file("1,10"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("1,10")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -87,8 +78,8 @@ TEST(CpuSetTest, TwoCpusWithComma) { } TEST(CpuSetTest, TwoCpusWithRange) { - ScopedTestFile file("1-2"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("1-2")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -96,8 +87,8 @@ TEST(CpuSetTest, TwoCpusWithRange) { } TEST(CpuSetTest, TenCpusWithRange) { - ScopedTestFile file("9-18"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("9-18")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -105,8 +96,8 @@ TEST(CpuSetTest, TenCpusWithRange) { } TEST(CpuSetTest, MultiItems) { - ScopedTestFile file("0, 2-4, 128"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("0, 2-4, 128")); CpuSet set; ASSERT_TRUE(set.ParseSysFile(file.GetFd())); @@ -114,14 +105,16 @@ TEST(CpuSetTest, MultiItems) { } TEST(CpuSetTest, IntersectWith) { - ScopedTestFile file1("9-19"); - ASSERT_TRUE(file1.IsOk()); + ScopedTmpFile file1; + ASSERT_TRUE(file1.InitString("9-19")); + CpuSet set1; ASSERT_TRUE(set1.ParseSysFile(file1.GetFd())); ASSERT_EQ(11, set1.GetCount()); - ScopedTestFile file2("16-24"); - ASSERT_TRUE(file2.IsOk()); + ScopedTmpFile file2; + ASSERT_TRUE(file2.InitString("16-24")); + CpuSet set2; ASSERT_TRUE(set2.ParseSysFile(file2.GetFd())); ASSERT_EQ(9, set2.GetCount()); @@ -132,8 +125,9 @@ TEST(CpuSetTest, IntersectWith) { } TEST(CpuSetTest, SelfIntersection) { - ScopedTestFile file1("9-19"); - ASSERT_TRUE(file1.IsOk()); + ScopedTmpFile file1; + ASSERT_TRUE(file1.InitString("9-19")); + CpuSet set1; ASSERT_TRUE(set1.ParseSysFile(file1.GetFd())); ASSERT_EQ(11, set1.GetCount()); @@ -143,14 +137,16 @@ TEST(CpuSetTest, SelfIntersection) { } TEST(CpuSetTest, EmptyIntersection) { - ScopedTestFile file1("0-19"); - ASSERT_TRUE(file1.IsOk()); + ScopedTmpFile file1; + ASSERT_TRUE(file1.InitString("0-19")); + CpuSet set1; ASSERT_TRUE(set1.ParseSysFile(file1.GetFd())); ASSERT_EQ(20, set1.GetCount()); - ScopedTestFile file2("20-39"); - ASSERT_TRUE(file2.IsOk()); + ScopedTmpFile file2; + ASSERT_TRUE(file2.InitString("20-39")); + CpuSet set2; ASSERT_TRUE(set2.ParseSysFile(file2.GetFd())); ASSERT_EQ(20, set2.GetCount()); diff --git a/src/client/linux/minidump_writer/line_reader_unittest.cc b/src/client/linux/minidump_writer/line_reader_unittest.cc index 3062c39f7..b96ebf9d0 100644 --- a/src/client/linux/minidump_writer/line_reader_unittest.cc +++ b/src/client/linux/minidump_writer/line_reader_unittest.cc @@ -32,7 +32,7 @@ #include "client/linux/minidump_writer/line_reader.h" #include "breakpad_googletest_includes.h" -#include "common/linux/tests/auto_testfile.h" +#include "common/linux/scoped_tmpfile.h" using namespace google_breakpad; @@ -40,22 +40,11 @@ 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()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("")); LineReader reader(file.GetFd()); const char* line; @@ -64,8 +53,8 @@ TEST(LineReaderTest, EmptyFile) { } TEST(LineReaderTest, OneLineTerminated) { - ScopedTestFile file("a\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a\n")); LineReader reader(file.GetFd()); const char* line; @@ -80,8 +69,8 @@ TEST(LineReaderTest, OneLineTerminated) { } TEST(LineReaderTest, OneLine) { - ScopedTestFile file("a"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a")); LineReader reader(file.GetFd()); const char* line; @@ -96,8 +85,8 @@ TEST(LineReaderTest, OneLine) { } TEST(LineReaderTest, TwoLinesTerminated) { - ScopedTestFile file("a\nb\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a\nb\n")); LineReader reader(file.GetFd()); const char* line; @@ -118,8 +107,8 @@ TEST(LineReaderTest, TwoLinesTerminated) { } TEST(LineReaderTest, TwoLines) { - ScopedTestFile file("a\nb"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("a\nb")); LineReader reader(file.GetFd()); const char* line; @@ -142,8 +131,8 @@ TEST(LineReaderTest, TwoLines) { TEST(LineReaderTest, MaxLength) { char l[LineReader::kMaxLineLen-1]; memset(l, 'a', sizeof(l)); - ScopedTestFile file(l, sizeof(l)); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitData(l, sizeof(l))); LineReader reader(file.GetFd()); const char* line; @@ -158,8 +147,8 @@ 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()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitData(l, sizeof(l))); LineReader reader(file.GetFd()); const char* line; diff --git a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc index f6d3e2859..cbdc5fbce 100644 --- a/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc +++ b/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc @@ -35,33 +35,19 @@ #include "client/linux/minidump_writer/proc_cpuinfo_reader.h" #include "breakpad_googletest_includes.h" -#include "common/linux/tests/auto_testfile.h" +#include "common/linux/scoped_tmpfile.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()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -69,8 +55,8 @@ TEST(ProcCpuInfoReaderTest, EmptyFile) { } TEST(ProcCpuInfoReaderTest, OneLineTerminated) { - ScopedTestFile file("foo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -82,8 +68,8 @@ TEST(ProcCpuInfoReaderTest, OneLineTerminated) { } TEST(ProcCpuInfoReaderTest, OneLine) { - ScopedTestFile file("foo : bar"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -97,8 +83,8 @@ TEST(ProcCpuInfoReaderTest, OneLine) { } TEST(ProcCpuInfoReaderTest, TwoLinesTerminated) { - ScopedTestFile file("foo : bar\nzoo : tut\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar\nzoo : tut\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -114,8 +100,8 @@ TEST(ProcCpuInfoReaderTest, TwoLinesTerminated) { } TEST(ProcCpuInfoReaderTest, SkipMalformedLine) { - ScopedTestFile file("this line should have a column\nfoo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("this line should have a column\nfoo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -127,8 +113,8 @@ TEST(ProcCpuInfoReaderTest, SkipMalformedLine) { } TEST(ProcCpuInfoReaderTest, SkipOneEmptyLine) { - ScopedTestFile file("\n\nfoo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("\n\nfoo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -140,8 +126,8 @@ TEST(ProcCpuInfoReaderTest, SkipOneEmptyLine) { } TEST(ProcCpuInfoReaderTest, SkipEmptyField) { - ScopedTestFile file(" : bar\nzoo : tut\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString(" : bar\nzoo : tut\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -153,8 +139,8 @@ TEST(ProcCpuInfoReaderTest, SkipEmptyField) { } TEST(ProcCpuInfoReaderTest, SkipTwoEmptyLines) { - ScopedTestFile file("foo : bar\n\n\nfoo : bar\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo : bar\n\n\nfoo : bar\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -170,8 +156,8 @@ TEST(ProcCpuInfoReaderTest, SkipTwoEmptyLines) { } TEST(ProcCpuInfoReaderTest, FieldWithSpaces) { - ScopedTestFile file("foo bar : zoo\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo bar : zoo\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; @@ -183,8 +169,8 @@ TEST(ProcCpuInfoReaderTest, FieldWithSpaces) { } TEST(ProcCpuInfoReaderTest, EmptyValue) { - ScopedTestFile file("foo :\n"); - ASSERT_TRUE(file.IsOk()); + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("foo :\n")); ProcCpuInfoReader reader(file.GetFd()); const char* field; diff --git a/src/common/dwarf/elf_reader.cc b/src/common/dwarf/elf_reader.cc index 5fd1cfb96..7664377cb 100644 --- a/src/common/dwarf/elf_reader.cc +++ b/src/common/dwarf/elf_reader.cc @@ -39,9 +39,9 @@ #include #include -#include #include #include +#include #include // TODO(saugustine): Add support for compressed debug. // Also need to add configure tests for zlib. @@ -107,6 +107,12 @@ const int kAARCH64PLT0Size = 0x20; // Suffix for PLT functions when it needs to be explicitly identified as such. const char kPLTFunctionSuffix[] = "@plt"; +// Replace callsites of this function to std::string_view::starts_with after +// adopting C++20. +bool StringViewStartsWith(std::string_view sv, std::string_view prefix) { + return sv.compare(0, prefix.size(), prefix) == 0; +} + } // namespace namespace google_breakpad { @@ -215,7 +221,7 @@ class ElfSectionReader { (header_.sh_offset - offset_aligned); // Check for and handle any compressed contents. - //if (name == ".zdebug_") + //if (StringViewStartsWith(name, ".zdebug_")) // DecompressZlibContents(); // TODO(saugustine): Add support for proposed elf-section flag // "SHF_COMPRESS". @@ -359,8 +365,8 @@ class ElfReaderImpl { // "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) { + std::string_view name{GetSectionName(section_headers_[k].sh_name)}; + if (StringViewStartsWith(name, ".text")) { base_for_text_ = section_headers_[k].sh_addr - section_headers_[k].sh_offset; break; @@ -809,9 +815,11 @@ class ElfReaderImpl { // 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; + std::string_view name{GetSectionName(section_headers_[k].sh_name)}; + if (StringViewStartsWith(name, ".debug") || + StringViewStartsWith(name, ".zdebug")) { + return true; + } } return false; } @@ -1213,11 +1221,15 @@ const char* ElfReader::GetSectionInfoByName(const string& section_name, } } -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; +bool ElfReader::SectionNamesMatch(std::string_view name, + std::string_view sh_name) { + std::string_view debug_prefix{".debug_"}; + std::string_view zdebug_prefix{".zdebug_"}; + if (StringViewStartsWith(name, debug_prefix) && + StringViewStartsWith(sh_name, zdebug_prefix)) { + name.remove_prefix(debug_prefix.length()); + sh_name.remove_prefix(zdebug_prefix.length()); + return name == sh_name; } return name == sh_name; } diff --git a/src/common/dwarf/elf_reader.h b/src/common/dwarf/elf_reader.h index 672969d81..a6dec7555 100644 --- a/src/common/dwarf/elf_reader.h +++ b/src/common/dwarf/elf_reader.h @@ -16,6 +16,7 @@ #define COMMON_DWARF_ELF_READER_H__ #include +#include #include #include "common/dwarf/types.h" @@ -145,7 +146,8 @@ class ElfReader { // 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); + static bool SectionNamesMatch(std::string_view name, + std::string_view sh_name); private: // Lazily initialize impl32_ and return it. diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index e7e595e76..7da8507d7 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -33,7 +33,9 @@ // Implementation of google_breakpad::DwarfCFIToModule. // See dwarf_cfi_to_module.h for details. +#include #include +#include #include "common/dwarf_cfi_to_module.h" @@ -151,7 +153,7 @@ bool DwarfCFIToModule::Entry(size_t offset, uint64_t address, uint64_t length, // need to check them here. // Get ready to collect entries. - entry_ = new Module::StackFrameEntry; + entry_ = std::make_unique(); entry_->address = address; entry_->size = length; entry_offset_ = offset; @@ -258,8 +260,7 @@ bool DwarfCFIToModule::ValExpressionRule(uint64_t address, int reg, } bool DwarfCFIToModule::End() { - module_->AddStackFrameEntry(entry_); - entry_ = NULL; + module_->AddStackFrameEntry(std::move(entry_)); return true; } diff --git a/src/common/dwarf_cfi_to_module.h b/src/common/dwarf_cfi_to_module.h index 3b092654d..42b618d5b 100644 --- a/src/common/dwarf_cfi_to_module.h +++ b/src/common/dwarf_cfi_to_module.h @@ -43,6 +43,7 @@ #include #include +#include #include #include "common/module.h" @@ -131,9 +132,9 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { DwarfCFIToModule(Module* module, const vector& register_names, Reporter* reporter) : module_(module), register_names_(register_names), reporter_(reporter), - entry_(NULL), return_address_(-1), cfa_name_(".cfa"), ra_name_(".ra") { + return_address_(-1), cfa_name_(".cfa"), ra_name_(".ra") { } - virtual ~DwarfCFIToModule() { delete entry_; } + virtual ~DwarfCFIToModule() = default; virtual bool Entry(size_t offset, uint64_t address, uint64_t length, uint8_t version, const string& augmentation, @@ -170,7 +171,7 @@ class DwarfCFIToModule: public CallFrameInfo::Handler { Reporter* reporter_; // The current entry we're constructing. - Module::StackFrameEntry* entry_; + std::unique_ptr entry_; // The section offset of the current frame description entry, for // use in error messages. diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 4915e6ffc..b436f7653 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -495,9 +495,42 @@ bool LoadDwarfCFI(const string& dwarf_filename, google_breakpad::CallFrameInfo::Reporter dwarf_reporter(dwarf_filename, section_name); - google_breakpad::CallFrameInfo parser(cfi, cfi_size, - &byte_reader, &handler, &dwarf_reporter, - eh_frame); + if (!IsCompressedHeader(section)) { + google_breakpad::CallFrameInfo parser(cfi, cfi_size, + &byte_reader, &handler, + &dwarf_reporter, eh_frame); + parser.Start(); + return true; + } + + typename ElfClass::Chdr chdr; + uint32_t compression_header_size = + GetCompressionHeader(chdr, cfi, cfi_size); + + if (compression_header_size == 0 || chdr.ch_size == 0) { + fprintf(stderr, "%s: decompression failed at header\n", + dwarf_filename.c_str()); + return false; + } + if (compression_header_size > cfi_size) { + fprintf(stderr, "%s: decompression error, compression_header too large\n", + dwarf_filename.c_str()); + return false; + } + + cfi += compression_header_size; + cfi_size -= compression_header_size; + + std::pair uncompressed = + UncompressSectionContents(cfi, cfi_size, chdr.ch_size); + + if (uncompressed.first == nullptr || uncompressed.second == 0) { + fprintf(stderr, "%s: decompression failed\n", dwarf_filename.c_str()); + return false; + } + google_breakpad::CallFrameInfo parser(uncompressed.first, uncompressed.second, + &byte_reader, &handler, &dwarf_reporter, + eh_frame); parser.Start(); return true; } diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc index 4aee38d6a..3c33be99a 100644 --- a/src/common/linux/elf_symbols_to_module.cc +++ b/src/common/linux/elf_symbols_to_module.cc @@ -36,6 +36,9 @@ #include #include +#include +#include + #include "common/byte_cursor.h" #include "common/module.h" @@ -156,7 +159,7 @@ bool ELFSymbolsToModule(const uint8_t* symtab_section, while(!iterator->at_end) { if (ELF32_ST_TYPE(iterator->info) == STT_FUNC && iterator->shndx != SHN_UNDEF) { - Module::Extern* ext = new Module::Extern(iterator->value); + auto ext = std::make_unique(iterator->value); ext->name = SymbolString(iterator->name_offset, strings); #if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle. int status = 0; @@ -168,7 +171,7 @@ bool ELFSymbolsToModule(const uint8_t* symtab_section, free(demangled); } #endif - module->AddExtern(ext); + module->AddExtern(std::move(ext)); } ++iterator; } diff --git a/src/common/linux/libcurl_wrapper.cc b/src/common/linux/libcurl_wrapper.cc index 096681614..a53087d9c 100644 --- a/src/common/linux/libcurl_wrapper.cc +++ b/src/common/linux/libcurl_wrapper.cc @@ -47,6 +47,7 @@ LibcurlWrapper::LibcurlWrapper() LibcurlWrapper::~LibcurlWrapper() { if (init_ok_) { (*easy_cleanup_)(curl_); + (*global_cleanup_)(); dlclose(curl_lib_); } } @@ -262,6 +263,10 @@ bool LibcurlWrapper::SetFunctionPointers() { SET_AND_CHECK_FUNCTION_POINTER(formfree_, "curl_formfree", void(*)(curl_httppost*)); + + SET_AND_CHECK_FUNCTION_POINTER(global_cleanup_, + "curl_global_cleanup", + void(*)(void)); return true; } diff --git a/src/common/linux/libcurl_wrapper.h b/src/common/linux/libcurl_wrapper.h index f4a4dca40..f8f961c1b 100644 --- a/src/common/linux/libcurl_wrapper.h +++ b/src/common/linux/libcurl_wrapper.h @@ -39,6 +39,9 @@ #include "third_party/curl/curl.h" namespace google_breakpad { + +// This class is only safe to be used on single-threaded code because of its +// usage of libcurl's curl_global_cleanup(). class LibcurlWrapper { public: LibcurlWrapper(); @@ -111,6 +114,7 @@ class LibcurlWrapper { CURLcode (*easy_getinfo_)(CURL*, CURLINFO info, ...); void (*easy_reset_)(CURL*); void (*formfree_)(struct curl_httppost*); + void (*global_cleanup_)(void); }; } diff --git a/src/common/linux/scoped_pipe.cc b/src/common/linux/scoped_pipe.cc new file mode 100644 index 000000000..b13f8d459 --- /dev/null +++ b/src/common/linux/scoped_pipe.cc @@ -0,0 +1,128 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (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/scoped_pipe.h" + +#include + +#include "common/linux/eintr_wrapper.h" + +namespace google_breakpad { + +ScopedPipe::ScopedPipe() { + fds_[0] = -1; + fds_[1] = -1; +} + +ScopedPipe::~ScopedPipe() { + CloseReadFd(); + CloseWriteFd(); +} + +bool ScopedPipe::Init() { + return pipe(fds_) == 0; +} + +void ScopedPipe::CloseReadFd() { + if (fds_[0] != -1) { + close(fds_[0]); + fds_[0] = -1; + } +} + +void ScopedPipe::CloseWriteFd() { + if (fds_[1] != -1) { + close(fds_[1]); + fds_[1] = -1; + } +} + +bool ScopedPipe::ReadLine(std::string& line) { + // Simple buffered file read. `read_buffer_` stores previously read bytes, and + // we either return a line from this buffer, or we append blocks of read bytes + // to the buffer until we have a complete line. + size_t eol_index = read_buffer_.find('\n'); + + // While we don't have a full line, and read pipe is valid. + while (eol_index == std::string::npos && GetReadFd() != -1) { + // Read a block of 128 bytes from the read pipe. + char read_buf[128]; + ssize_t read_len = HANDLE_EINTR( + read(GetReadFd(), read_buf, sizeof(read_buf))); + if (read_len <= 0) { + // Pipe error, or pipe has been closed. + CloseReadFd(); + break; + } + + // Append the block, and check if we have a full line now. + read_buffer_.append(read_buf, read_len); + eol_index = read_buffer_.find('\n'); + } + + if (eol_index != std::string::npos) { + // We have a full line to output. + line = read_buffer_.substr(0, eol_index); + if (eol_index < read_buffer_.size()) { + read_buffer_ = read_buffer_.substr(eol_index + 1); + } else { + read_buffer_ = ""; + } + + return true; + } + + if (read_buffer_.size()) { + // We don't have a full line to output, but we can only reach here if the + // pipe has closed and there are some bytes left at the end, so we should + // return those bytes. + line = std::move(read_buffer_); + read_buffer_ = ""; + + return true; + } + + // We don't have any buffered data left, and the pipe has closed. + return false; +} + +int ScopedPipe::Dup2WriteFd(int new_fd) const { + return dup2(fds_[1], new_fd); +} + +bool ScopedPipe::WriteForTesting(const void* bytes, size_t bytes_len) { + ssize_t r = HANDLE_EINTR(write(GetWriteFd(), bytes, bytes_len)); + if (r != static_cast(bytes_len)) { + CloseWriteFd(); + return false; + } + + return true; +} + +} // namespace google_breakpad diff --git a/src/common/linux/scoped_pipe.h b/src/common/linux/scoped_pipe.h new file mode 100644 index 000000000..25394c2ab --- /dev/null +++ b/src/common/linux/scoped_pipe.h @@ -0,0 +1,115 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (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_SCOPED_PIPE_H_ +#define COMMON_LINUX_SCOPED_PIPE_H_ + +#include +#include + +namespace google_breakpad { + +// Small RAII wrapper for a pipe pair. +// +// Example (both ends of pipe in same process): +// ScopedPipe tmp; +// std::string line; +// if (tmp.Init() && tmp.Write(bytes, bytes_len)) { +// tmp.CloseWriteFd(); +// while (tmp.ReadLine(&line)) { +// std::cerr << line << std::endl; +// } +// } +// +// Example (reading output from a child process): +// ScopedPipe tmp; +// if (fork()) { +// // Parent process, read from the read end of the pipe. +// std::string line; +// while (tmp.ReadLine(line)) { +// // Process output... +// } +// // Close read pipe once done processing the output that we wanted, this +// // should ensure that the child process exits even if we didn't read all +// // of the output. +// tmp.CloseReadFd(); +// // Parent process should handle waiting for child to exit here... +// } else { +// // Child process, close the read fd and dup the write fd before exec'ing. +// tmp.CloseReadFd(); +// tmp.Dup2WriteFd(STDOUT_FILENO); +// tmp.Dup2WriteFd(STDERR_FILENO); +// execl("some-command", "some-arguments"); +// } +class ScopedPipe { + public: + ScopedPipe(); + ~ScopedPipe(); + + // Creates the pipe pair - returns false on error. + bool Init(); + + // Close the read pipe. This only needs to be used when the read pipe needs to + // be closed earlier. + void CloseReadFd(); + + // Close the write pipe. This only needs to be used when the write pipe needs + // to be closed earlier. + void CloseWriteFd(); + + // Reads characters until newline or end of pipe. On read failure this will + // close the read pipe, but continue to return true and read buffered lines + // until the internal buffering is exhausted. This will block if there is no + // data available on the read pipe. + bool ReadLine(std::string& line); + + // Writes bytes to the write end of the pipe, returns false and closes write + // pipe on failure. + bool WriteForTesting(const void* bytes, size_t bytes_len); + + // Calls the dup2 system call to replace any existing open file descriptor + // with number new_fd with a copy of the current write end file descriptor + // for the pipe. + int Dup2WriteFd(int new_fd) const; + + private: + int GetReadFd() const { + return fds_[0]; + } + + int GetWriteFd() const { + return fds_[1]; + } + + int fds_[2]; + std::string read_buffer_; +}; + +} // namespace google_breakpad + +#endif // COMMON_LINUX_SCOPED_PIPE_H_ diff --git a/src/common/linux/scoped_pipe_unittest.cc b/src/common/linux/scoped_pipe_unittest.cc new file mode 100644 index 000000000..a7d6272cf --- /dev/null +++ b/src/common/linux/scoped_pipe_unittest.cc @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// scoped_pipe_unittest.cc: Unit tests for google_breakpad::ScopedPipe. + +#include "common/linux/scoped_pipe.h" + +#include "breakpad_googletest_includes.h" + +namespace google_breakpad { + +TEST(ScopedPipeTest, WriteAndClose) { + const char kTestData[] = "One\nTwo\nThree"; + ScopedPipe pipe; + std::string line; + + ASSERT_TRUE(pipe.Init()); + ASSERT_TRUE(pipe.WriteForTesting(kTestData, strlen(kTestData))); + pipe.CloseWriteFd(); + + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "One"); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "Two"); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "Three"); + ASSERT_FALSE(pipe.ReadLine(line)); +} + +TEST(ScopedPipeTest, MultipleWrites) { + const char kTestDataOne[] = "One\n"; + const char kTestDataTwo[] = "Two\n"; + ScopedPipe pipe; + std::string line; + + ASSERT_TRUE(pipe.Init()); + ASSERT_TRUE(pipe.WriteForTesting(kTestDataOne, strlen(kTestDataOne))); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "One"); + + ASSERT_TRUE(pipe.WriteForTesting(kTestDataTwo, strlen(kTestDataTwo))); + ASSERT_TRUE(pipe.ReadLine(line)); + ASSERT_EQ(line, "Two"); +} + +} // namespace google_breakpad diff --git a/src/common/linux/scoped_tmpfile.cc b/src/common/linux/scoped_tmpfile.cc new file mode 100644 index 000000000..229e8d42c --- /dev/null +++ b/src/common/linux/scoped_tmpfile.cc @@ -0,0 +1,99 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (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 that is deleted in the +// destructor. + +#include "common/linux/scoped_tmpfile.h" + +#include +#include +#include +#include +#include + +#include "common/linux/eintr_wrapper.h" + +#if !defined(__ANDROID__) +#define TEMPDIR "/tmp" +#else +#define TEMPDIR "/data/local/tmp" +#endif + +namespace google_breakpad { + +ScopedTmpFile::ScopedTmpFile() = default; + +ScopedTmpFile::~ScopedTmpFile() { + if (fd_ >= 0) { + close(fd_); + fd_ = -1; + } +} + +bool ScopedTmpFile::InitEmpty() { + // Prevent calling Init when fd_ is already valid, leaking the file. + if (fd_ != -1) { + return false; + } + + // Respect the TMPDIR environment variable. + const char* tempdir = getenv("TMPDIR"); + if (!tempdir) { + tempdir = TEMPDIR; + } + + // Create a temporary file that is not linked in to the filesystem, and that + // is only accessible by the current user. + fd_ = open(tempdir, O_TMPFILE | O_RDWR, S_IRUSR | S_IWUSR); + + return fd_ >= 0; +} + +bool ScopedTmpFile::InitString(const char* text) { + return InitData(text, strlen(text)); +} + +bool ScopedTmpFile::InitData(const void* data, size_t data_len) { + if (!InitEmpty()) { + return false; + } + + return SetContents(data, data_len); +} + +bool ScopedTmpFile::SetContents(const void* data, size_t data_len) { + ssize_t r = HANDLE_EINTR(write(fd_, data, data_len)); + if (r != static_cast(data_len)) { + return false; + } + + return 0 == lseek(fd_, 0, SEEK_SET); +} + +} // namespace google_breakpad diff --git a/src/common/linux/scoped_tmpfile.h b/src/common/linux/scoped_tmpfile.h new file mode 100644 index 000000000..dffec182f --- /dev/null +++ b/src/common/linux/scoped_tmpfile.h @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (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 that is deleted in the +// destructor. + +#ifndef COMMON_LINUX_SCOPED_TMPFILE_H_ +#define COMMON_LINUX_SCOPED_TMPFILE_H_ + +#include + +namespace google_breakpad { + +// Small RAII wrapper for temporary files. +// +// Example: +// ScopedTmpFile tmp; +// if (tmp.Init("Some file contents")) { +// ... +// } +class ScopedTmpFile { + public: + // Initialize the ScopedTmpFile object - this does not create the temporary + // file until Init is called. + ScopedTmpFile(); + + // Destroy temporary file on scope exit. + ~ScopedTmpFile(); + + // Creates the empty temporary file - returns true iff the temporary file was + // created successfully. Should always be checked before using the file. + bool InitEmpty(); + + // Creates the temporary file with the provided C string. The terminating null + // is not written. Returns true iff the temporary file was created + // successfully and the contents were written successfully. + bool InitString(const char* text); + + // Creates the temporary file with the provided data. Returns true iff the + // temporary file was created successfully and the contents were written + // successfully. + bool InitData(const void* data, size_t data_len); + + // Returns the Posix file descriptor for the test file, or -1 if Init() + // returned false. Note: on Windows, this always returns -1. + int GetFd() const { + return fd_; + } + + private: + // Set the contents of the temporary file, and seek back to the start of the + // file. On failure, returns false. + bool SetContents(const void* data, size_t data_len); + + int fd_ = -1; +}; + +} // namespace google_breakpad + +#endif // COMMON_LINUX_SCOPED_TMPFILE_H_ diff --git a/src/common/linux/scoped_tmpfile_unittest.cc b/src/common/linux/scoped_tmpfile_unittest.cc new file mode 100644 index 000000000..f82c5998b --- /dev/null +++ b/src/common/linux/scoped_tmpfile_unittest.cc @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// scoped_tmpfile_unittest.cc: Unit tests for google_breakpad::ScopedTmpfile. + +#include "common/linux/scoped_tmpfile.h" + +#include + +#include "breakpad_googletest_includes.h" + +using google_breakpad::ScopedTmpFile; + +TEST(ScopedTmpFileTest, CheckContentsMatch) { + ScopedTmpFile file; + ASSERT_TRUE(file.InitString("Test")); + + char file_contents[5] = {0}; + ASSERT_EQ(4, read(file.GetFd(), file_contents, sizeof(file_contents))); + EXPECT_STREQ(file_contents, "Test"); +} diff --git a/src/common/linux/tests/auto_testfile.h b/src/common/linux/tests/auto_testfile.h deleted file mode 100644 index e2d2ff23b..000000000 --- a/src/common/linux/tests/auto_testfile.h +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2013 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (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 -#include - -#include - -#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(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(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(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/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 1f8303128..9658b2c6d 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -268,7 +268,8 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( return &object_files_[i]; } assert(best_match == NULL); - return NULL; + // Fall through since NXFindBestFatArch can't find arm slices on x86_64 + // macOS 13. See FB11955188. } // Check for an exact match with cpu_type and cpu_subtype. @@ -276,7 +277,8 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( it != object_files_.end(); ++it) { if (static_cast(it->cputype) == cpu_type && - static_cast(it->cpusubtype) == cpu_subtype) + (static_cast(it->cpusubtype) & ~CPU_SUBTYPE_MASK) == + (cpu_subtype & ~CPU_SUBTYPE_MASK)) return &*it; } @@ -285,8 +287,11 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( // 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); + "type: %d and cpu subtype: %d.\n", cpu_type, cpu_subtype); + if (!can_convert_to_fat_arch) { + fprintf(stderr, "Furthermore, at least one object file is larger " + "than 2**32.\n"); + } return NULL; } @@ -678,18 +683,6 @@ bool DumpSymbols::ReadSymbolData(Module** out_module) { 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. diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index 97632ce02..c2e1b40b9 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -117,19 +117,14 @@ class DumpSymbols { 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. + // Read the selected object file's debugging information and store it in + // `module`. The caller owns the resulting module object and must delete + // it when finished. bool ReadSymbolData(Module** module); // Return an identifier string for the file this DumpSymbols is dumping. diff --git a/src/common/module.cc b/src/common/module.cc index 442b910dc..75782ab16 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -117,12 +117,6 @@ Module::~Module() { it != functions_.end(); ++it) { delete *it; } - for (vector::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) { @@ -155,12 +149,11 @@ bool Module::AddFunction(Function* function) { } if (it_ext != externs_.end()) { if (enable_multiple_field_) { - Extern* found_ext = *it_ext; + Extern* found_ext = it_ext->get(); // If the PUBLIC is for the same symbol as the FUNC, don't mark multiple. function->is_multiple |= found_ext->name != function->name || found_ext->is_multiple; } - delete *it_ext; externs_.erase(it_ext); } #if _DEBUG @@ -194,25 +187,22 @@ bool Module::AddFunction(Function* function) { return true; } -void Module::AddStackFrameEntry(StackFrameEntry* stack_frame_entry) { +void Module::AddStackFrameEntry(std::unique_ptr stack_frame_entry) { if (!AddressIsInModule(stack_frame_entry->address)) { return; } - stack_frame_entries_.push_back(stack_frame_entry); + stack_frame_entries_.push_back(std::move(stack_frame_entry)); } -void Module::AddExtern(Extern* ext) { +void Module::AddExtern(std::unique_ptr ext) { if (!AddressIsInModule(ext->address)) { return; } - std::pair ret = externs_.insert(ext); + std::pair ret = externs_.emplace(std::move(ext)); if (!ret.second && enable_multiple_field_) { (*ret.first)->is_multiple = true; - // Free the duplicate that was not inserted because this Module - // now owns it. - delete ext; } } @@ -223,7 +213,11 @@ void Module::GetFunctions(vector* vec, void Module::GetExterns(vector* vec, vector::iterator i) { - vec->insert(i, externs_.begin(), externs_.end()); + auto pos = vec->insert(i, externs_.size(), nullptr); + for (const std::unique_ptr& ext : externs_) { + *pos = ext.get(); + ++pos; + } } Module::File* Module::FindFile(const string& name) { @@ -265,7 +259,11 @@ void Module::GetFiles(vector* vec) { } void Module::GetStackFrameEntries(vector* vec) const { - *vec = stack_frame_entries_; + vec->clear(); + vec->reserve(stack_frame_entries_.size()); + for (const auto& ent : stack_frame_entries_) { + vec->push_back(ent.get()); + } } void Module::AssignSourceIds( @@ -441,7 +439,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { // Write out 'PUBLIC' records. for (ExternSet::const_iterator extern_it = externs_.begin(); extern_it != externs_.end(); ++extern_it) { - Extern* ext = *extern_it; + Extern* ext = extern_it->get(); stream << "PUBLIC " << (ext->is_multiple ? "m " : "") << hex << (ext->address - load_address_) << " 0 " << ext->name << dec << "\n"; @@ -450,10 +448,9 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { if (symbol_data & CFI) { // Write out 'STACK CFI INIT' and 'STACK CFI' records. - vector::const_iterator frame_it; - for (frame_it = stack_frame_entries_.begin(); + for (auto frame_it = stack_frame_entries_.begin(); frame_it != stack_frame_entries_.end(); ++frame_it) { - StackFrameEntry* entry = *frame_it; + StackFrameEntry* entry = frame_it->get(); stream << "STACK CFI INIT " << hex << (entry->address - load_address_) << " " << entry->size << " " << dec; diff --git a/src/common/module.h b/src/common/module.h index a8fcc81e0..c1fd9f59c 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -292,7 +292,18 @@ class Module { }; struct ExternCompare { - bool operator() (const Extern* lhs, const Extern* rhs) const { + // Defining is_transparent allows + // std::set, ExternCompare>::find() to be called + // with an Extern* and have set use the overloads below. + using is_transparent = void; + bool operator() (const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const { + return lhs->address < rhs->address; + } + bool operator() (const Extern* lhs, const std::unique_ptr& rhs) const { + return lhs->address < rhs->address; + } + bool operator() (const std::unique_ptr& lhs, const Extern* rhs) const { return lhs->address < rhs->address; } }; @@ -340,12 +351,12 @@ class Module { // 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); + void AddStackFrameEntry(std::unique_ptr 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); + void AddExtern(std::unique_ptr 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 @@ -465,7 +476,7 @@ class Module { typedef set FunctionSet; // A set containing Extern structures, sorted by address. - typedef set ExternSet; + typedef set, ExternCompare> ExternSet; // The module owns all the files and functions that have been added // to it; destroying the module frees the Files and Functions these @@ -477,7 +488,7 @@ class Module { // The module owns all the call frame info entries that have been // added to it. - vector stack_frame_entries_; + vector> 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 220add030..39727554f 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -36,8 +36,10 @@ #include #include +#include #include #include +#include #include "breakpad_googletest_includes.h" #include "common/module.h" @@ -137,7 +139,7 @@ TEST(Module, WriteRelativeLoadAddress) { m.AddFunction(function); // Some stack information. - Module::StackFrameEntry* entry = new Module::StackFrameEntry(); + auto entry = std::make_unique(); entry->address = 0x30f9e5c83323973dULL; entry->size = 0x49fc9ca7c7c13dc2ULL; entry->initial_rules[".cfa"] = "he was a handsome man"; @@ -145,7 +147,7 @@ TEST(Module, WriteRelativeLoadAddress) { entry->rule_changes[0x30f9e5c83323973eULL]["how"] = "do you like your blueeyed boy"; entry->rule_changes[0x30f9e5c83323973eULL]["Mister"] = "Death"; - m.AddStackFrameEntry(entry); + m.AddStackFrameEntry(std::move(entry)); // Set the load address. Doing this after adding all the data to // the module must work fine. @@ -242,7 +244,7 @@ TEST(Module, WriteNoCFI) { m.AddFunction(function); // Some stack information. - Module::StackFrameEntry* entry = new Module::StackFrameEntry(); + auto entry = std::make_unique(); entry->address = 0x30f9e5c83323973dULL; entry->size = 0x49fc9ca7c7c13dc2ULL; entry->initial_rules[".cfa"] = "he was a handsome man"; @@ -250,7 +252,7 @@ TEST(Module, WriteNoCFI) { entry->rule_changes[0x30f9e5c83323973eULL]["how"] = "do you like your blueeyed boy"; entry->rule_changes[0x30f9e5c83323973eULL]["Mister"] = "Death"; - m.AddStackFrameEntry(entry); + m.AddStackFrameEntry(std::move(entry)); // Set the load address. Doing this after adding all the data to // the module must work fine. @@ -321,18 +323,18 @@ TEST(Module, WriteOutOfRangeAddresses) { // Add three stack frames (one lower, one in, and one higher than the allowed // address range). Only the middle frame should be captured. - Module::StackFrameEntry* entry1 = new Module::StackFrameEntry(); + auto entry1 = std::make_unique(); entry1->address = 0x1000ULL; entry1->size = 0x100ULL; - m.AddStackFrameEntry(entry1); - Module::StackFrameEntry* entry2 = new Module::StackFrameEntry(); + m.AddStackFrameEntry(std::move(entry1)); + auto entry2 = std::make_unique(); entry2->address = 0x2000ULL; entry2->size = 0x100ULL; - m.AddStackFrameEntry(entry2); - Module::StackFrameEntry* entry3 = new Module::StackFrameEntry(); + m.AddStackFrameEntry(std::move(entry2)); + auto entry3 = std::make_unique(); entry3->address = 0x3000ULL; entry3->size = 0x100ULL; - m.AddStackFrameEntry(entry3); + m.AddStackFrameEntry(std::move(entry3)); // Add a function outside the allowed range. Module::File* file = m.FindFile("file_name.cc"); @@ -346,9 +348,9 @@ TEST(Module, WriteOutOfRangeAddresses) { m.AddFunction(function); // Add an extern outside the allowed range. - Module::Extern* extern1 = new Module::Extern(0x5000ULL); + auto extern1 = std::make_unique(0x5000ULL); extern1->name = "_xyz"; - m.AddExtern(extern1); + m.AddExtern(std::move(extern1)); m.Write(s, ALL_SYMBOL_DATA); @@ -357,10 +359,7 @@ TEST(Module, WriteOutOfRangeAddresses) { s.str().c_str()); // Cleanup - Prevent Memory Leak errors. - delete (extern1); delete (function); - delete (entry3); - delete (entry1); } TEST(Module, ConstructAddFrames) { @@ -368,22 +367,22 @@ TEST(Module, ConstructAddFrames) { 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(); + auto entry1 = std::make_unique(); entry1->address = 0xddb5f41285aa7757ULL; entry1->size = 0x1486493370dc5073ULL; - m.AddStackFrameEntry(entry1); + m.AddStackFrameEntry(std::move(entry1)); // Second STACK CFI entry, with initial rules but no deltas. - Module::StackFrameEntry* entry2 = new Module::StackFrameEntry(); + auto entry2 = std::make_unique(); 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); + m.AddStackFrameEntry(std::move(entry2)); // Third STACK CFI entry, with initial rules and deltas. - Module::StackFrameEntry* entry3 = new Module::StackFrameEntry(); + auto entry3 = std::make_unique(); entry3->address = 0x5e8d0db0a7075c6cULL; entry3->size = 0x1c7edb12a7aea229ULL; entry3->initial_rules[".cfa"] = "Whose woods are these"; @@ -395,7 +394,7 @@ TEST(Module, ConstructAddFrames) { "his house is in"; entry3->rule_changes[0x36682fad3763ffffULL][".cfa"] = "I think I know"; - m.AddStackFrameEntry(entry3); + m.AddStackFrameEntry(std::move(entry3)); // Check that Write writes STACK CFI records properly. m.Write(s, ALL_SYMBOL_DATA); @@ -541,13 +540,13 @@ TEST(Module, ConstructExterns) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xffff); + auto extern1 = std::make_unique(0xffff); extern1->name = "_abc"; - Module::Extern* extern2 = new Module::Extern(0xaaaa); + auto extern2 = std::make_unique(0xaaaa); extern2->name = "_xyz"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); m.Write(s, ALL_SYMBOL_DATA); string contents = s.str(); @@ -566,13 +565,13 @@ TEST(Module, ConstructDuplicateExterns) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xffff); + auto extern1 = std::make_unique(0xffff); extern1->name = "_xyz"; - Module::Extern* extern2 = new Module::Extern(0xffff); + auto extern2 = std::make_unique(0xffff); extern2->name = "_abc"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); m.Write(s, ALL_SYMBOL_DATA); string contents = s.str(); @@ -589,13 +588,13 @@ TEST(Module, ConstructDuplicateExternsMultiple) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", true); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xffff); + auto extern1 = std::make_unique(0xffff); extern1->name = "_xyz"; - Module::Extern* extern2 = new Module::Extern(0xffff); + auto extern2 = std::make_unique(0xffff); extern2->name = "_abc"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); m.Write(s, ALL_SYMBOL_DATA); string contents = s.str(); @@ -613,13 +612,13 @@ TEST(Module, ConstructFunctionsAndExternsWithSameAddress) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xabc0); + auto extern1 = std::make_unique(0xabc0); extern1->name = "abc"; - Module::Extern* extern2 = new Module::Extern(0xfff0); + auto extern2 = std::make_unique(0xfff0); extern2->name = "xyz"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); Module::Function* function = new Module::Function("_xyz", 0xfff0); Module::Range range(0xfff0, 0x10); @@ -644,13 +643,13 @@ TEST(Module, ConstructFunctionsAndExternsWithSameAddressMultiple) { Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, "", true); // Two externs. - Module::Extern* extern1 = new Module::Extern(0xabc0); + auto extern1 = std::make_unique(0xabc0); extern1->name = "abc"; - Module::Extern* extern2 = new Module::Extern(0xfff0); + auto extern2 = std::make_unique(0xfff0); extern2->name = "xyz"; - m.AddExtern(extern1); - m.AddExtern(extern2); + m.AddExtern(std::move(extern1)); + m.AddExtern(std::move(extern2)); Module::Function* function = new Module::Function("_xyz", 0xfff0); Module::Range range(0xfff0, 0x10); @@ -676,17 +675,17 @@ TEST(Module, ConstructFunctionsAndThumbExternsWithSameAddress) { Module m(MODULE_NAME, MODULE_OS, "arm", MODULE_ID); // Two THUMB externs. - Module::Extern* thumb_extern1 = new Module::Extern(0xabc1); + auto thumb_extern1 = std::make_unique(0xabc1); thumb_extern1->name = "thumb_abc"; - Module::Extern* thumb_extern2 = new Module::Extern(0xfff1); + auto thumb_extern2 = std::make_unique(0xfff1); thumb_extern2->name = "thumb_xyz"; - Module::Extern* arm_extern1 = new Module::Extern(0xcc00); + auto arm_extern1 = std::make_unique(0xcc00); arm_extern1->name = "arm_func"; - m.AddExtern(thumb_extern1); - m.AddExtern(thumb_extern2); - m.AddExtern(arm_extern1); + m.AddExtern(std::move(thumb_extern1)); + m.AddExtern(std::move(thumb_extern2)); + m.AddExtern(std::move(arm_extern1)); // The corresponding function from the DWARF debug data have the actual // address. diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index 6cdb96a27..3d026c22c 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -36,6 +36,8 @@ #include #include +#include +#include #include "common/stabs_to_module.h" #include "common/using_std_string.h" @@ -132,7 +134,7 @@ bool StabsToModule::Line(uint64_t address, const char *name, int number) { } bool StabsToModule::Extern(const string& name, uint64_t address) { - Module::Extern *ext = new Module::Extern(address); + auto ext = std::make_unique(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) { @@ -142,7 +144,7 @@ bool StabsToModule::Extern(const string& name, uint64_t address) { } else { ext->name = name; } - module_->AddExtern(ext); + module_->AddExtern(std::move(ext)); return true; } diff --git a/src/google_breakpad/common/minidump_exception_mac.h b/src/google_breakpad/common/minidump_exception_mac.h index feb47079f..acfafaa0f 100644 --- a/src/google_breakpad/common/minidump_exception_mac.h +++ b/src/google_breakpad/common/minidump_exception_mac.h @@ -65,6 +65,10 @@ typedef enum { MD_EXCEPTION_MAC_MACH_SYSCALL = 8, /* EXC_MACH_SYSCALL */ MD_EXCEPTION_MAC_RPC_ALERT = 9, + /* EXC_RESOURCE */ + MD_EXCEPTION_MAC_RESOURCE = 11, + /* EXC_GUARD */ + MD_EXCEPTION_MAC_GUARD = 12, /* EXC_RPC_ALERT */ MD_EXCEPTION_MAC_SIMULATED = 0x43507378, /* Fake exception code used by Crashpad's SimulateCrash ('CPsx'). */ diff --git a/src/google_breakpad/common/minidump_format.h b/src/google_breakpad/common/minidump_format.h index 9edead934..1526afcea 100644 --- a/src/google_breakpad/common/minidump_format.h +++ b/src/google_breakpad/common/minidump_format.h @@ -1096,10 +1096,23 @@ typedef struct { MDRawSimpleStringDictionaryEntry entries[0]; } MDRawSimpleStringDictionary; +typedef struct { + MDRVA name; + uint16_t type; + uint16_t reserved; + MDRVA value; +} MDRawCrashpadAnnotation; + +typedef struct { + uint32_t count; + MDLocationDescriptor objects[0]; /* MDRawCrashpadAnnotation */ +} MDRawCrashpadAnnotationList; + typedef struct { uint32_t version; MDLocationDescriptor list_annotations; MDLocationDescriptor simple_annotations; /* MDRawSimpleStringDictionary */ + MDLocationDescriptor annotation_objects; /* MDRawCrashpadAnnotationList */ } MDRawModuleCrashpadInfo; typedef struct { @@ -1118,6 +1131,8 @@ typedef struct { MDGUID client_id; MDLocationDescriptor simple_annotations; /* MDRawSimpleStringDictionary */ MDLocationDescriptor module_list; /* MDRawModuleCrashpadInfoList */ + uint32_t reserved; + uint64_t address_mask; } MDRawCrashpadInfo; #if defined(_MSC_VER) diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index 54d288176..934a0e3ef 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -1189,10 +1189,21 @@ class MinidumpLinuxMapsList : public MinidumpStream { // at the time the minidump was generated. class MinidumpCrashpadInfo : public MinidumpStream { public: + struct AnnotationObject { + uint16_t type; + std::string name; + std::vector value; + }; + const MDRawCrashpadInfo* crashpad_info() const { return valid_ ? &crashpad_info_ : NULL; } + const std::vector>* + GetModuleCrashpadInfoAnnotationObjects() const { + return valid_ ? &module_crashpad_info_annotation_objects_ : NULL; + } + // Print a human-readable representation of the object to stdout. void Print(); @@ -1211,6 +1222,9 @@ class MinidumpCrashpadInfo : public MinidumpStream { std::vector> module_crashpad_info_list_annotations_; std::vector> module_crashpad_info_simple_annotations_; + std::vector> + module_crashpad_info_annotation_objects_; + std::map simple_annotations_; }; @@ -1320,6 +1334,10 @@ class Minidump { off_t offset, std::map* simple_string_dictionary); + bool ReadCrashpadAnnotationsList( + off_t offset, + std::vector* annotations_list); + // 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 diff --git a/src/processor/disassembler_objdump.cc b/src/processor/disassembler_objdump.cc index dfe10d58e..f000b4b41 100644 --- a/src/processor/disassembler_objdump.cc +++ b/src/processor/disassembler_objdump.cc @@ -32,8 +32,10 @@ #include "processor/disassembler_objdump.h" -#ifdef __linux__ #include +#include + +#include #include #include #include @@ -41,76 +43,15 @@ #include #include +#include "common/linux/eintr_wrapper.h" +#include "common/linux/scoped_pipe.h" +#include "common/linux/scoped_tmpfile.h" #include "processor/logging.h" namespace google_breakpad { namespace { -const size_t kMaxX86InstructionLength = 15; -// Small RAII wrapper for temporary files. -// -// Example: -// ScopedTmpFile tmp("/tmp/tmpfile-XXXX"); -// if (tmp.Create()) { -// std::cerr << tmp.path() << std::endl; -// } -class ScopedTmpFile { - public: - // Initialize the ScopedTmpFile object - this does not create the temporary - // file yet. - ScopedTmpFile(const char* path_format); - ~ScopedTmpFile(); - - // Creates the temporary file, returns true on success. - bool Create(); - - // Writes bytes to the temporary file, returns true on success. - bool Write(const uint8_t* bytes, unsigned int bytes_len); - - // Returns the path of the temporary file. - string path() const { return path_; } - - private: - int fd_; - string path_; -}; - -ScopedTmpFile::ScopedTmpFile(const char* path_format) : path_(path_format) {} - -ScopedTmpFile::~ScopedTmpFile() { - if (fd_) { - close(fd_); - unlink(path_.c_str()); - } -} - -bool ScopedTmpFile::Create() { - fd_ = mkstemp(path_.data()); - if (fd_ < 0) { - unlink(path_.c_str()); - fd_ = 0; - path_ = ""; - return false; - } - - return true; -} - -bool ScopedTmpFile::Write(const uint8_t* bytes, unsigned int bytes_len) { - if (fd_) { - do { - ssize_t result = write(fd_, bytes, bytes_len); - if (result < 0) { - break; - } - - bytes += result; - bytes_len -= result; - } while (bytes_len); - } - - return bytes_len == 0; -} +const size_t kMaxX86InstructionLength = 15; bool IsInstructionPrefix(const string& token) { if (token == "lock" || token == "rep" || token == "repz" || @@ -285,47 +226,87 @@ bool DisassemblerObjdump::DisassembleInstruction(uint32_t cpu, return false; } - // Create two temporary files, one for the raw instruction bytes to pass to - // objdump, and one for the output, and write the bytes to the input file. - ScopedTmpFile raw_bytes_file("/tmp/breakpad_mem_region-raw_bytes-XXXXXX"); - ScopedTmpFile disassembly_file("/tmp/breakpad_mem_region-disassembly-XXXXXX"); - if (!raw_bytes_file.Create() || !disassembly_file.Create() || - !raw_bytes_file.Write(raw_bytes, raw_bytes_len)) { - BPLOG(ERROR) << "Failed creating temporary files."; + // Create a temporary file for the raw instruction bytes to pass to + // objdump, and write the bytes to the input file. + ScopedTmpFile raw_bytes_file; + if (!raw_bytes_file.InitData(raw_bytes, raw_bytes_len)) { + BPLOG(ERROR) << "Failed creating temporary file."; return false; } - char cmd[1024] = {0}; - snprintf(cmd, 1024, - "objdump -D --no-show-raw-insn -b binary -M intel -m %s %s > %s", - architecture.c_str(), raw_bytes_file.path().c_str(), - disassembly_file.path().c_str()); - if (system(cmd)) { - BPLOG(ERROR) << "Failed to call objdump."; + // Create a pipe to use to read the disassembly back from objdump. + ScopedPipe disassembly_pipe; + if (!disassembly_pipe.Init()) { + BPLOG(ERROR) << "Failed creating pipe for output."; return false; } - // Pipe each output line into the string until the string contains the first - // instruction from objdump. - std::ifstream objdump_stream(disassembly_file.path()); + pid_t child_pid = fork(); + if (child_pid < 0) { + BPLOG(ERROR) << "Fork failed."; + return false; + } + + if (child_pid == 0) { + // In the child process, set up the input and output file descriptors. + if (dup2(raw_bytes_file.GetFd(), STDIN_FILENO) < 0 || + disassembly_pipe.Dup2WriteFd(STDOUT_FILENO) < 0 || + disassembly_pipe.Dup2WriteFd(STDERR_FILENO) < 0) { + BPLOG(ERROR) << "Failed dup'ing file descriptors."; + exit(-1); + } - // Match the instruction line, from: - // 0: lock cmpxchg DWORD PTR [esi+0x10],eax - // extract the string "lock cmpxchg DWORD PTR [esi+0x10],eax" - std::regex instruction_regex( - "^\\s+[0-9a-f]+:\\s+" // " 0:" - "((?:\\s*\\S*)+)$"); // "lock cmpxchg..." + // We need to close the read end of the pipe in the child process so that + // when the parent closes it, the pipe is disconnected. + disassembly_pipe.CloseReadFd(); - std::string line; - std::smatch match; - do { - if (!getline(objdump_stream, line)) { - BPLOG(INFO) << "Failed to find instruction in objdump output."; + // We use "/proc/self/fd/0" here to allow objdump to parse an unnamed file, + // since objdump does not have a mode to read from stdin. This cannot be + // used with a pipe, since objdump requires that the input is a standard + // file. + execlp("objdump", "objdump", "-D", "--no-show-raw-insn", "-b", "binary", + "-M", "intel", "-m", architecture.c_str(), "/proc/self/fd/0", + nullptr); + + BPLOG(ERROR) << "Failed to exec objdump."; + exit(-1); + } else { + // In the parent process, parse the objdump output. + + // Match the instruction line, from: + // 0: lock cmpxchg DWORD PTR [esi+0x10],eax + // extract the string "lock cmpxchg DWORD PTR [esi+0x10],eax" + std::regex instruction_regex( + "^\\s+[0-9a-f]+:\\s+" // " 0:" + "((?:\\s*\\S*)+)$"); // "lock cmpxchg..." + + std::string line; + std::smatch match; + while (disassembly_pipe.ReadLine(line)) { + if (std::regex_match(line, match, instruction_regex)) { + instruction = match[1].str(); + break; + } + } + + // Close the read pipe so that objdump will exit (in case we broke out of + // the loop above before reading all of the output). + disassembly_pipe.CloseReadFd(); + + // Now wait for objdump to exit. + int status = 0; + HANDLE_EINTR(waitpid(child_pid, &status, 0)); + + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + BPLOG(ERROR) << "objdump didn't run successfully."; return false; } - } while (!std::regex_match(line, match, instruction_regex)); - instruction = match[1].str(); + if (instruction == "") { + BPLOG(ERROR) << "Failed to find instruction in objdump output."; + return false; + } + } return true; } @@ -498,23 +479,5 @@ bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context, uint64_t& address) { return CalculateAddress(context, dest_, address); } -} // namespace google_breakpad - -#else // __linux__ -namespace google_breakpad { -DisassemblerObjdump::DisassemblerObjdump(const uint32_t cpu, - const MemoryRegion* memory_region, - uint64_t address) {} - -bool DisassemblerObjdump::CalculateSrcAddress(const DumpContext& context, - uint64_t& address) { - return false; -} - -bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context, - uint64_t& address) { - return false; -} -} // namespace google_breakpad -#endif // __linux__ +} // namespace google_breakpad \ No newline at end of file diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 63a126560..c48bbdf5c 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -41,7 +41,9 @@ #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/stack_frame.h" +#ifdef __linux__ #include "processor/disassembler_objdump.h" +#endif #include "processor/logging.h" namespace { @@ -156,7 +158,7 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() { } bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { -#ifdef _WIN32 +#ifndef __linux__ BPLOG(INFO) << "MinGW does not support fork and exec. Terminating method."; return false; #else @@ -220,7 +222,7 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { } else { return false; } -#endif // _WIN32 +#endif // __linux__ } bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) { diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index d56db98e9..135770d50 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -215,6 +216,12 @@ inline void Swap(MDRawSimpleStringDictionaryEntry* entry) { Swap(&entry->value); } +inline void Swap(MDRawCrashpadAnnotation* annotation) { + Swap(&annotation->name); + Swap(&annotation->type); + Swap(&annotation->value); +} + 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++) { @@ -5260,6 +5267,7 @@ MinidumpCrashpadInfo::MinidumpCrashpadInfo(Minidump* minidump) module_crashpad_info_(), module_crashpad_info_list_annotations_(), module_crashpad_info_simple_annotations_(), + module_crashpad_info_annotation_objects_(), simple_annotations_() { } @@ -5267,16 +5275,52 @@ MinidumpCrashpadInfo::MinidumpCrashpadInfo(Minidump* minidump) bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { valid_ = false; - if (expected_size != sizeof(crashpad_info_)) { - BPLOG(ERROR) << "MinidumpCrashpadInfo size mismatch, " << expected_size << - " != " << sizeof(crashpad_info_); + // Support old minidumps that do not implement newer crashpad_info_ + // fields, currently limited to the address mask. + static_assert(sizeof(crashpad_info_) == 64, + "Updated ::Read for new crashpad_info field."); + + constexpr size_t crashpad_info_min_size = + offsetof(decltype(crashpad_info_), reserved); + if (expected_size < crashpad_info_min_size) { + BPLOG(ERROR) << "MinidumpCrashpadInfo size mismatch, " << expected_size + << " < " << crashpad_info_min_size; return false; } - if (!minidump_->ReadBytes(&crashpad_info_, sizeof(crashpad_info_))) { + if (!minidump_->ReadBytes(&crashpad_info_, crashpad_info_min_size)) { BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read Crashpad info"; return false; } + expected_size -= crashpad_info_min_size; + + // Read `reserved` if available. + size_t crashpad_reserved_size = sizeof(crashpad_info_.reserved); + if (expected_size >= crashpad_reserved_size) { + if (!minidump_->ReadBytes( + &crashpad_info_.reserved, + crashpad_reserved_size)) { + BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read reserved"; + return false; + } + expected_size -= crashpad_reserved_size; + } else { + crashpad_info_.reserved = 0; + } + + // Read `address_mask` if available. + size_t crashpad_address_mask_size = sizeof(crashpad_info_.address_mask); + if (expected_size >= crashpad_address_mask_size) { + if (!minidump_->ReadBytes( + &crashpad_info_.address_mask, + crashpad_address_mask_size)) { + BPLOG(ERROR) << "MinidumpCrashpadInfo cannot read address mask"; + return false; + } + expected_size -= crashpad_address_mask_size; + } else { + crashpad_info_.address_mask = 0; + } if (minidump_->swap()) { Swap(&crashpad_info_.version); @@ -5284,6 +5328,8 @@ bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { Swap(&crashpad_info_.client_id); Swap(&crashpad_info_.simple_annotations); Swap(&crashpad_info_.module_list); + Swap(&crashpad_info_.reserved); + Swap(&crashpad_info_.address_mask); } if (crashpad_info_.simple_annotations.data_size) { @@ -5347,6 +5393,7 @@ bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { Swap(&module_crashpad_info.version); Swap(&module_crashpad_info.list_annotations); Swap(&module_crashpad_info.simple_annotations); + Swap(&module_crashpad_info.annotation_objects); } std::vector list_annotations; @@ -5371,11 +5418,23 @@ bool MinidumpCrashpadInfo::Read(uint32_t expected_size) { } } + std::vector annotation_objects; + if (module_crashpad_info.annotation_objects.data_size) { + if (!minidump_->ReadCrashpadAnnotationsList( + module_crashpad_info.annotation_objects.rva, + &annotation_objects)) { + BPLOG(ERROR) + << "MinidumpCrashpadInfo cannot read Crashpad annotations list"; + return false; + } + } + module_crashpad_info_links_.push_back( module_crashpad_info_links[index].minidump_module_list_index); module_crashpad_info_.push_back(module_crashpad_info); module_crashpad_info_list_annotations_.push_back(list_annotations); module_crashpad_info_simple_annotations_.push_back(simple_annotations); + module_crashpad_info_annotation_objects_.push_back(annotation_objects); } } @@ -5420,6 +5479,7 @@ void MinidumpCrashpadInfo::Print() { printf(" module_list[%d].simple_annotations[\"%s\"] = %s\n", module_index, annot.first.c_str(), annot.second.c_str()); } + printf(" address_mask = %" PRIu64 "\n", crashpad_info_.address_mask); } printf("\n"); @@ -6225,6 +6285,73 @@ bool Minidump::ReadSimpleStringDictionary( return true; } +bool Minidump::ReadCrashpadAnnotationsList( + off_t offset, + std::vector* annotations_list) { + annotations_list->clear(); + + if (!SeekSet(offset)) { + BPLOG(ERROR) << "Minidump cannot seek to annotations_list"; + return false; + } + + uint32_t count; + if (!ReadBytes(&count, sizeof(count))) { + BPLOG(ERROR) << "Minidump cannot read annotations_list count"; + return false; + } + + if (swap_) { + Swap(&count); + } + + scoped_array objects( + new MDRawCrashpadAnnotation[count]); + + // Read the entire array in one fell swoop, instead of reading one entry + // at a time in the loop. + if (!ReadBytes(&objects[0], sizeof(MDRawCrashpadAnnotation) * count)) { + BPLOG(ERROR) << "Minidump could not read annotations_list"; + return false; + } + + for (uint32_t index = 0; index < count; ++index) { + MDRawCrashpadAnnotation annotation = objects[index]; + + if (swap_) { + Swap(&annotation); + } + + string name; + if (!ReadUTF8String(annotation.name, &name)) { + BPLOG(ERROR) << "Minidump could not read annotation name"; + return false; + } + + if (!SeekSet(annotation.value)) { + BPLOG(ERROR) << "Minidump cannot seek to annotations value"; + return false; + } + + uint32_t value_length; + if (!ReadBytes(&value_length, sizeof(value_length))) { + BPLOG(ERROR) << "Minidump could not read annotation value length"; + return false; + } + + std::vector value_data(value_length); + if (!ReadBytes(value_data.data(), value_length)) { + BPLOG(ERROR) << "Minidump could not read annotation value"; + return false; + } + + MinidumpCrashpadInfo::AnnotationObject object = {annotation.type, name, + value_data}; + annotations_list->push_back(object); + } + + return true; +} bool Minidump::SeekToStreamType(uint32_t stream_type, uint32_t* stream_length) { diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index bf561dfa4..0073ae4e5 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -44,11 +44,14 @@ #include "google_breakpad/processor/process_state.h" #include "google_breakpad/processor/exploitability.h" #include "google_breakpad/processor/stack_frame_symbolizer.h" -#include "processor/disassembler_objdump.h" #include "processor/logging.h" #include "processor/stackwalker_x86.h" #include "processor/symbolic_constants_win.h" +#ifdef __linux__ +#include "processor/disassembler_objdump.h" +#endif + namespace google_breakpad { MinidumpProcessor::MinidumpProcessor(SymbolSupplier* supplier, @@ -760,6 +763,8 @@ bool MinidumpProcessor::GetProcessCreateTime(Minidump* dump, return true; } +#ifdef __linux__ + static bool IsCanonicalAddress(uint64_t address) { uint64_t sign_bit = (address >> 63) & 1; for (int shift = 48; shift < 63; ++shift) { @@ -832,6 +837,7 @@ static void CalculateFaultAddressFromInstruction(Minidump* dump, *address = write_address; } } +#endif // __linux__ // static string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, @@ -1243,6 +1249,14 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, reason = "EXC_RPC_ALERT / "; reason.append(flags_string); break; + case MD_EXCEPTION_MAC_RESOURCE: + reason = "EXC_RESOURCE / "; + reason.append(flags_string); + break; + case MD_EXCEPTION_MAC_GUARD: + reason = "EXC_GUARD / "; + reason.append(flags_string); + break; case MD_EXCEPTION_MAC_SIMULATED: reason = "Simulated Exception"; break; @@ -2062,6 +2076,7 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, static_cast(raw_system_info->processor_architecture), *address); +#ifdef __linux__ // For invalid accesses to non-canonical addresses, amd64 cpus don't provide // the fault address, so recover it from the disassembly and register state // if possible. @@ -2070,6 +2085,7 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address, && std::numeric_limits::max() == *address) { CalculateFaultAddressFromInstruction(dump, address); } +#endif // __linux__ } return reason; diff --git a/src/processor/minidump_unittest.cc b/src/processor/minidump_unittest.cc index 9936a7e4a..53d44ae1e 100644 --- a/src/processor/minidump_unittest.cc +++ b/src/processor/minidump_unittest.cc @@ -47,6 +47,7 @@ namespace { using google_breakpad::Minidump; using google_breakpad::MinidumpContext; +using google_breakpad::MinidumpCrashpadInfo; using google_breakpad::MinidumpException; using google_breakpad::MinidumpMemoryInfo; using google_breakpad::MinidumpMemoryInfoList; @@ -130,6 +131,42 @@ TEST_F(MinidumpTest, TestMinidumpFromStream) { //TODO: add more checks here } +TEST_F(MinidumpTest, TestMinidumpWithCrashpadAnnotations) { + string crashpad_minidump_file = + string(getenv("srcdir") ? getenv("srcdir") : ".") + + "/src/processor/testdata/minidump_crashpad_annotation.dmp"; + + Minidump minidump(crashpad_minidump_file); + ASSERT_EQ(minidump.path(), crashpad_minidump_file); + ASSERT_TRUE(minidump.Read()); + + MinidumpCrashpadInfo* crashpad_info = minidump.GetCrashpadInfo(); + ASSERT_TRUE(crashpad_info != NULL); + + const std::vector>* + annotation_objects_list = + crashpad_info->GetModuleCrashpadInfoAnnotationObjects(); + ASSERT_EQ(2U, annotation_objects_list->size()); + + std::vector annotation_objects = + annotation_objects_list->at(0); + ASSERT_EQ(5U, annotation_objects.size()); + + std::vector annotation_names; + for (size_t i = 0; i < annotation_objects.size(); i++) { + MinidumpCrashpadInfo::AnnotationObject annotation_object = + annotation_objects.at(i); + annotation_names.push_back(annotation_object.name); + ASSERT_TRUE(annotation_object.type > 0); + ASSERT_TRUE(annotation_object.value.size() > 0); + } + + std::vector expected_strings{ + "exceptionReason", "exceptionName", "firstexception_bt", "firstexception", + "CounterAnnotation"}; + ASSERT_EQ(annotation_names, expected_strings); +} + TEST(Dump, ReadBackEmpty) { Dump dump(0); dump.Finish(); diff --git a/src/processor/testdata/minidump_crashpad_annotation.dmp b/src/processor/testdata/minidump_crashpad_annotation.dmp new file mode 100644 index 000000000..00cfc5a3a Binary files /dev/null and b/src/processor/testdata/minidump_crashpad_annotation.dmp differ diff --git a/src/tools/mac/crash_report/crash_report.mm b/src/tools/mac/crash_report/crash_report.mm deleted file mode 100644 index 36322ec8f..000000000 --- a/src/tools/mac/crash_report/crash_report.mm +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright 2010 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (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 - -#include -#include - -#include - -#include - -#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(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(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 symbol_supplier( - new OnDemandSymbolSupplier(search_dir, symbol_search_dir)); - scoped_ptr - minidump_processor(new MinidumpProcessor(symbol_supplier.get(), &resolver)); - ProcessState process_state; - scoped_ptr 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_date_stamp), ×truct); - char timestr[20]; - strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", ×truct); - 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)", - requesting_thread, - process_state.crashed() ? "crashed" : - "requested dump, did not crash"); - string requesting_thread_name = process_state.thread_names()->at(requesting_thread); - if (!requesting_thread_name.empty()) { - printf(" (name: %s)", requesting_thread_name.c_str()); - } - printf("\n"); - PrintStack(process_state.threads()->at(requesting_thread), cpu); - } - - // Print all of the threads in the dump. - int thread_count = static_cast(process_state.threads()->size()); - const std::vector - *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", thread_index); - string thread_name = process_state.thread_names()->at(thread_index); - if (!thread_name.empty()) { - printf(" (name: %s)", thread_name.c_str()); - } - printf("\n"); - 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 " - "/.\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/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj b/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj deleted file mode 100644 index 33204f7e2..000000000 --- a/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj +++ /dev/null @@ -1,618 +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 */; }; - 4214B800211109A600B769FA /* convert_old_arm64_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */; }; - 4247E6402110D5A500482558 /* path_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4247E63F2110D5A500482558 /* path_helper.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.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF192E0B1BC15D00F8391B /* dump_syms.cc */; }; - 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 */; }; - F47180561D745DEF0032F208 /* elf_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180541D745DEF0032F208 /* elf_reader.cc */; }; - F47180581D7467630032F208 /* proc_maps_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180571D7467630032F208 /* proc_maps_linux.cc */; }; - F471805A1D7468A40032F208 /* symbolic_constants_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = F47180591D7468A40032F208 /* symbolic_constants_win.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 = ""; }; - 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 = ""; }; - 162F64FD161C5ECB00CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = ""; }; - 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = convert_old_arm64_context.cc; path = ../../../processor/convert_old_arm64_context.cc; sourceTree = ""; }; - 4214B7FF211109A600B769FA /* convert_old_arm64_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_old_arm64_context.h; path = ../../../processor/convert_old_arm64_context.h; sourceTree = ""; }; - 4247E63E2110D5A500482558 /* path_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = path_helper.h; path = ../../../common/path_helper.h; sourceTree = ""; }; - 4247E63F2110D5A500482558 /* path_helper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = path_helper.cc; path = ../../../common/path_helper.cc; sourceTree = ""; }; - 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 = ""; }; - 9B3904950B2E52D90059FABE /* source_line_resolver_interface.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = source_line_resolver_interface.h; sourceTree = ""; }; - 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 = ""; }; - 9BDF16F90B1B8ACD00F8391B /* breakpad_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = breakpad_types.h; sourceTree = ""; }; - 9BDF16FA0B1B8ACD00F8391B /* minidump_format.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump_format.h; sourceTree = ""; }; - 9BDF16FC0B1B8ACD00F8391B /* call_stack.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = call_stack.h; sourceTree = ""; }; - 9BDF16FD0B1B8ACD00F8391B /* memory_region.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = memory_region.h; sourceTree = ""; }; - 9BDF16FE0B1B8ACD00F8391B /* minidump.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump.h; sourceTree = ""; }; - 9BDF16FF0B1B8ACD00F8391B /* minidump_processor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump_processor.h; sourceTree = ""; }; - 9BDF17000B1B8ACD00F8391B /* process_state.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = process_state.h; sourceTree = ""; }; - 9BDF17010B1B8ACD00F8391B /* stack_frame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stack_frame.h; sourceTree = ""; }; - 9BDF17020B1B8ACD00F8391B /* stack_frame_cpu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stack_frame_cpu.h; sourceTree = ""; }; - 9BDF17030B1B8ACD00F8391B /* stackwalker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stackwalker.h; sourceTree = ""; }; - 9BDF17040B1B8ACD00F8391B /* symbol_supplier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = symbol_supplier.h; sourceTree = ""; }; - 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 = ""; }; - 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = on_demand_symbol_supplier.mm; sourceTree = ""; }; - 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.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.cc; path = ../../../common/mac/dump_syms.cc; 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 = ""; }; - 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 = ""; }; - F407DC42185773C10064622B /* stackwalker_arm64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_arm64.cc; path = ../../../processor/stackwalker_arm64.cc; sourceTree = ""; }; - F407DC43185773C10064622B /* stackwalker_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_arm64.h; path = ../../../processor/stackwalker_arm64.h; sourceTree = ""; }; - F407DC44185773C10064622B /* stackwalker_mips.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_mips.cc; path = ../../../processor/stackwalker_mips.cc; sourceTree = ""; }; - F407DC45185773C10064622B /* stackwalker_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_mips.h; path = ../../../processor/stackwalker_mips.h; sourceTree = ""; }; - F407DC46185773C10064622B /* stackwalker_ppc64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_ppc64.cc; path = ../../../processor/stackwalker_ppc64.cc; sourceTree = ""; }; - F407DC47185773C10064622B /* stackwalker_ppc64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_ppc64.h; path = ../../../processor/stackwalker_ppc64.h; sourceTree = ""; }; - F44DDD8419C85CD50047280E /* dump_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dump_context.cc; path = ../../../processor/dump_context.cc; sourceTree = ""; }; - F44DDD8519C85CD50047280E /* dump_object.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dump_object.cc; path = ../../../processor/dump_object.cc; sourceTree = ""; }; - F44DDD8619C85CD50047280E /* microdump_processor.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = microdump_processor.cc; path = ../../../processor/microdump_processor.cc; sourceTree = ""; }; - F44DDD8A19C85CFB0047280E /* dump_context.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dump_context.h; path = ../../../google_breakpad/processor/dump_context.h; sourceTree = ""; }; - F44DDD8B19C85CFB0047280E /* dump_object.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dump_object.h; path = ../../../google_breakpad/processor/dump_object.h; sourceTree = ""; }; - F44DDD8C19C85CFC0047280E /* microdump_processor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump_processor.h; path = ../../../google_breakpad/processor/microdump_processor.h; sourceTree = ""; }; - F44DDD8D19C85CFC0047280E /* process_result.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = process_result.h; path = ../../../google_breakpad/processor/process_result.h; sourceTree = ""; }; - F47180541D745DEF0032F208 /* elf_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = elf_reader.cc; path = ../../../common/dwarf/elf_reader.cc; sourceTree = ""; }; - F47180551D745DEF0032F208 /* elf_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = elf_reader.h; path = ../../../common/dwarf/elf_reader.h; sourceTree = ""; }; - F47180571D7467630032F208 /* proc_maps_linux.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = proc_maps_linux.cc; path = ../../../processor/proc_maps_linux.cc; sourceTree = ""; }; - F47180591D7468A40032F208 /* symbolic_constants_win.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = symbolic_constants_win.cc; path = ../../../processor/symbolic_constants_win.cc; sourceTree = ""; }; - F4D43B2E1A38490700C290B2 /* microdump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = microdump.cc; path = ../../../processor/microdump.cc; sourceTree = ""; }; - F4D43B301A38492000C290B2 /* microdump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump.h; path = ../../../google_breakpad/processor/microdump.h; sourceTree = ""; }; - 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 = ( - 4214B7FE211109A600B769FA /* convert_old_arm64_context.cc */, - 4214B7FF211109A600B769FA /* convert_old_arm64_context.h */, - 4247E63F2110D5A500482558 /* path_helper.cc */, - 4247E63E2110D5A500482558 /* path_helper.h */, - 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.cc */, - 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 = ""; - }; - 08FB7795FE84155DC02AAC07 /* breakpad */ = { - isa = PBXGroup; - children = ( - 9BE650AB0B52FE1A00611104 /* common */, - 9BDF17280B1B8B0200F8391B /* processor */, - 9BDF16F70B1B8ACD00F8391B /* google_breakpad */, - ); - name = breakpad; - sourceTree = ""; - }; - 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - 08FB779EFE84155DC02AAC07 /* Foundation.framework */, - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76FA10486AA7600D96B5E /* crash_report */, - ); - name = Products; - sourceTree = ""; - }; - 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 = ""; - }; - 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 = ""; - }; - 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 = ""; - }; - 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 */, - F47180571D7467630032F208 /* proc_maps_linux.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 */, - F47180591D7468A40032F208 /* symbolic_constants_win.cc */, - ); - name = processor; - sourceTree = ""; - }; - 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 = ""; - }; - F9C7ECE10E8ABC7F00E953AD /* DWARF */ = { - isa = PBXGroup; - children = ( - F9C7ECE20E8ABCA600E953AD /* bytereader.cc */, - F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */, - 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */, - 8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */, - F47180541D745DEF0032F208 /* elf_reader.cc */, - F47180551D745DEF0032F208 /* elf_reader.h */, - F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */, - ); - name = DWARF; - sourceTree = ""; - }; -/* 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; - attributes = { - }; - buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "crash_report" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = en; - 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 */, - F47180581D7467630032F208 /* proc_maps_linux.cc 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 */, - F47180561D745DEF0032F208 /* elf_reader.cc in Sources */, - 9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */, - 9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */, - 9BDF21A70B1E825400F8391B /* dump_syms.cc 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 */, - F471805A1D7468A40032F208 /* symbolic_constants_win.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 */, - 4214B800211109A600B769FA /* convert_old_arm64_context.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 */, - 4247E6402110D5A500482558 /* path_helper.cc 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 = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - HEADER_SEARCH_PATHS = ../../../../src; - PRODUCT_NAME = crash_report; - }; - name = Debug; - }; - 1DEB927608733DD40010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - 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/src/tools/mac/crash_report/on_demand_symbol_supplier.h b/src/tools/mac/crash_report/on_demand_symbol_supplier.h deleted file mode 100644 index e265a78a9..000000000 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.h +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2006 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (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 -#include -#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 module_file_map_; - - // Map of allocated data buffers, keyed by module->code_file(). - map 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/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm deleted file mode 100644 index d4c4b1ab2..000000000 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2006 Google LLC -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google LLC nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (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 -#include -#include -#include -#include -#include -#include - -#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::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::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) { - DumpSymbols dump(ALL_SYMBOL_DATA, false); - if (dump.Read(module_path)) { - // 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_path.c_str()); - result = false; - } - } - - // Add the mapping - if (result) - module_file_map_[name] = [symbol_path fileSystemRepresentation]; - - return result; -} diff --git a/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj b/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj index 5b644e24c..c98b6ac54 100644 --- a/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj +++ b/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj @@ -1251,7 +1251,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; HEADER_SEARCH_PATHS = ( ../../.., ../../../common/mac/include/, @@ -1264,7 +1264,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; HEADER_SEARCH_PATHS = ( ../../.., ../../../common/mac/include/, diff --git a/src/tools/mac/dump_syms/dump_syms_tool.cc b/src/tools/mac/dump_syms/dump_syms_tool.cc index d0f29ba7d..2e05cbf3b 100644 --- a/src/tools/mac/dump_syms/dump_syms_tool.cc +++ b/src/tools/mac/dump_syms/dump_syms_tool.cc @@ -36,6 +36,8 @@ #include #include +#include +#include #include #include "common/mac/dump_syms.h" @@ -108,7 +110,8 @@ static void CopyCFIDataBetweenModules(Module* to_module, // 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)); + to_module->AddStackFrameEntry( + std::make_unique(*from_entry)); } } } diff --git a/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj b/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj index 903c66f15..b1dd6a112 100644 --- a/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj +++ b/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj @@ -371,7 +371,7 @@ 1DEB927508733DD40010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H; HEADER_SEARCH_PATHS = ( ../../.., @@ -385,7 +385,7 @@ 1DEB927608733DD40010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NDEBUG, diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go index d38f439ab..ba0672763 100644 --- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go @@ -63,12 +63,12 @@ var ( 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.") + apiKey = flag.String("api-key", "", "API key to use. If this is present, the `sym-upload-v2` protocol is used.\nSee https://chromium.googlesource.com/breakpad/breakpad/+/HEAD/docs/sym_upload_v2_protocol.md or\n`symupload`'s help for more information.") ) var ( // pathsToScan are the subpaths in the systemRoot that should be scanned for shared libraries. pathsToScan = []string{ - "/System/Library/Components", "/System/Library/Frameworks", "/System/Library/PrivateFrameworks", "/usr/lib", @@ -78,13 +78,26 @@ var ( optionalPathsToScan = []string{ // Gone in 10.15. "/Library/QuickTime", + // Not present in dumped dyld_shared_caches + "/System/Library/Components", } - // uploadServers are the list of servers to which symbols should be uploaded. - uploadServers = []string{ + // uploadServersV1 are the list of servers to which symbols should be + // uploaded when using the V1 protocol. + uploadServersV1 = []string{ "https://clients2.google.com/cr/symbol", "https://clients2.google.com/cr/staging_symbol", } + // uploadServersV2 are the list of servers to which symbols should be + // uploaded when using the V2 protocol. + uploadServersV2 = []string{ + "https://staging-crashsymbolcollector-pa.googleapis.com", + "https://prod-crashsymbolcollector-pa.googleapis.com", + } + + // uploadServers are the list of servers that should be used, accounting + // for whether v1 or v2 protocol is used. + uploadServers = uploadServersV1 // blacklistRegexps match paths that should be excluded from dumping. blacklistRegexps = []*regexp.Regexp{ @@ -101,6 +114,11 @@ func main() { flag.Parse() log.SetFlags(0) + // If `apiKey` is set, we're using the v2 protocol. + if len(*apiKey) > 0 { + uploadServers = uploadServersV2 + } + var uq *UploadQueue if *uploadOnlyPath != "" { @@ -194,17 +212,29 @@ func (uq *UploadQueue) Done() { close(uq.queue) } -func (uq *UploadQueue) worker() { +func (uq *UploadQueue) runSymUpload(symfile, server string) *exec.Cmd { symUpload := path.Join(*breakpadTools, "symupload") + args := []string{symfile, server} + if len(*apiKey) > 0 { + args = append([]string{"-p", "sym-upload-v2", "-k", *apiKey}, args...) + } + return exec.Command(symUpload, args...) +} +func (uq *UploadQueue) worker() { 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) + cmd := uq.runSymUpload(symfile, server) if output, err := cmd.Output(); err == nil { // Success. No retry needed. fmt.Printf("Uploaded %s to %s\n", symfile, server) break + } else if exitError, ok := err.(*exec.ExitError); ok && exitError.ExitCode() == 2 && *apiKey != "" { + // Exit code 2 in protocol v2 means the file already exists on the server. + // No point retrying. + fmt.Printf("File %s already exists on %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) diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.sh b/src/tools/mac/upload_system_symbols/upload_system_symbols.sh new file mode 100755 index 000000000..43fd98ed5 --- /dev/null +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +# Copyright 2023 Google LLC +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google LLC nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Finds the dyld_shared_cache on a system, extracts it, and dumps the symbols +# in Breakpad format to the directory passed as the first argument +# The script must be in the same directory as `dump_syms`, +# `upload_system_symbols` and `dsc_extractor` binaries. +# Exits with 0 if all supported architectures for this OS version were found and +# dumped, and nonzero otherwise. + +set -ex + +if [[ $# -ne 1 ]]; then + echo "usage: $0 " >& 2 + exit 1 +fi + +destination_dir="$1" + +dir="$(dirname "$0")" +dir="$(cd "${dir}"; pwd)" +major_version=$(sw_vers -productVersion | cut -d . -f 1) +if [[ "${major_version}" -lt 13 ]]; then + dsc_directory="/System/Library/dyld" +else + dsc_directory="/System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld" +fi + +working_dir=$(mktemp -d) +mkdir "${destination_dir}" +trap 'rm -rf "${working_dir}" "${destination_dir}"' EXIT + +architectures=(x86_64h) +missing_architectures=() +# macOS >= 13 on arm64 still has a x86_64 cache for Rosetta. +if [[ "${major_version}" -lt 13 ]] || [[ $(uname -p) == "arm" ]]; then + architectures+=( x86_64 ) +fi +if [[ "${major_version}" -ge 11 ]]; then + architectures+=( arm64e ) +fi + +for arch in "${architectures[@]}"; do + cache="${dsc_directory}/dyld_shared_cache_${arch}" + if [[ ! -f "${cache}" ]]; then + missing_architectures+=("${arch}") + continue + fi + "${dir}/dsc_extractor" \ + "${cache}" \ + "${working_dir}/${arch}" + "${dir}/upload_system_symbols" \ + --breakpad-tools="${dir}" \ + --system-root="${working_dir}/${arch}" \ + --dump-to="${destination_dir}" +done +if [[ "${#missing_architectures[@]}" -eq "${#architectures[@]}" ]]; then + echo "Couldn't locate dyld_shared_cache for any architectures" >& 2 + echo "in ${dsc_directory}. Exiting." >& 2 + exit 1 +fi + +rm -rf "${working_dir}" +# We have results now, so let's keep `destination_dir`. +trap '' EXIT + +"${dir}/upload_system_symbols" \ + --breakpad-tools="${dir}" \ + --system-root=/ \ + --dump-to="${destination_dir}" + +set +x +echo +echo "Dumped!" +echo "To upload, run:" +echo +echo "'${dir}/upload_system_symbols'" \\ +echo " --breakpad-tools='${dir}'" \\ +echo " --api-key=" \\ +echo " --upload-from='${destination_dir}'" + +if [[ "${#missing_architectures[@]}" -gt 0 ]]; then + echo "dyld_shared_cache not found for architecture(s):" >& 2 + echo " " "${missing_architectures[@]}" >& 2 + echo "You'll need to get symbols for them elsewhere." >& 2 + exit 1 +fi