├── .gitignore ├── LICENSE ├── README.md ├── cymbal.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ └── cymbalTests.xcscheme ├── cymbal ├── Info.plist ├── callstack_creation.c ├── callstack_creation.h ├── cpp_demangler.c ├── cpp_demangler.h ├── cymbal.c ├── cymbal.h ├── frame_creation.c ├── frame_creation.h ├── frame_lookup_cache.c ├── frame_lookup_cache.h ├── image_lookup.c ├── image_lookup.h ├── symbol_creation.c ├── symbol_creation.h ├── symbol_storage.c └── symbol_storage.h ├── cymbalMacDynamic └── Info.plist ├── cymbalStressTestMac └── main.m ├── cymbalStressTestiOS ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Info.plist └── main.m ├── cymbalTests ├── Info.plist ├── callstack_creation_tests.m ├── cpp_demangler_tests.m ├── cymbal_api_tests.m ├── frame_creation_tests.m ├── frame_lookup_cache_test.m ├── image_lookup_tests.m ├── symbol_creation_tests.m └── symbol_storage_tests.m ├── cymbaliOSDynamic └── Info.plist └── cymbaltweak ├── Makefile ├── Tweak.x ├── control ├── cymbalTweak.plist └── packages └── com.ethanarbuckle.cymbaltweak_1.0.0-1+debug_iphoneos-arm.deb /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .theos/ 3 | *xcuserdata/ 4 | xcuserdata 5 | *.xcworkspacedata 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Cymbal 2 | 3 | A very fast objective-c symbolicator. Cymbal finds symbolicated method names for memory addresses. 4 | 5 | #### Usage / API 6 | ###### callstack retrieval 7 | `CFArrayRef cymbal_callstack(void);` 8 | 9 | // Get a callstack for the current execution context 10 | CFArrayRef callstack = cymbal_callstack(); 11 | NSLog(@"cymbal: %@", callstack); 12 | 13 | // Cymbal callstacks need to be released after use 14 | CFRelease(callstack); 15 | 16 | 17 | ###### single address symbolication 18 | `const char *cymbolicate(void *address);` 19 | 20 | // Some address that points to an objective-c method 21 | IMP redactedImp = class_getMethodImplementation(objc_getClass("NSFileManager"), sel_registerName("_processHasUbiquityContainerEntitlement")); 22 | 23 | // A symbolicated frame is created for the address 24 | const char *symbolicated_frame = cymbolicate((void *)redactedImp); 25 | NSLog(@"%s", symbolicated_frame); 26 | 27 | // Frames need to be released 28 | free((void *)symbolicated_frame); 29 | 30 | 31 | 32 | ###### single address symbolication with more detail 33 | `int cymbal_symbol_for_address(void *address, struct Cymbal **cymbal);` 34 | 35 | // Some address that points to an objective-c method 36 | IMP redactedImp = class_getMethodImplementation(objc_getClass("NSFileManager"), sel_registerName("_processHasUbiquityContainerEntitlement")); 37 | 38 | // A Cymbal object is found for the address 39 | struct Cymbal *symbol = (struct Cymbal *)malloc(sizeof(struct Cymbal)); 40 | cymbal_symbol_for_address((void *)redactedImp, &symbol); 41 | 42 | NSLog(@"%s", symbol->class_name); 43 | NSLog(@"%s", symbol->method_name); 44 | NSLog(@"%d", symbol->is_class_method); 45 | 46 | // Cymbals need to be released 47 | free(symbol); 48 | 49 | 50 | 51 | 52 | #### Cymbol vs NSThread 53 | 54 | This is a callstack generated via `+[NSThread callStackSymbols]`: 55 | 56 | 57 | 0 cymbalStressTestiOS 0x0000000100d44570 __main_block_invoke_2 + 188 58 | 1 CFNetwork 0x00000001821f1c1c + 32 59 | 2 CFNetwork 0x000000018220a93c + 152 60 | 3 Foundation 0x000000018268ae88 + 16 61 | 4 Foundation 0x00000001825cc8d0 + 72 62 | 5 Foundation 0x00000001825cbcac + 848 63 | 6 libdispatch.dylib 0x000000010110d220 _dispatch_client_callout + 16 64 | 7 libdispatch.dylib 0x0000000101119850 _dispatch_block_invoke_direct + 232 65 | 8 libdispatch.dylib 0x000000010110d220 _dispatch_client_callout + 16 66 | 9 libdispatch.dylib 0x0000000101119850 _dispatch_block_invoke_direct + 232 67 | 10 libdispatch.dylib 0x0000000101119734 dispatch_block_perform + 104 68 | 11 Foundation 0x000000018268c750 + 376 69 | 12 libdispatch.dylib 0x000000010110d220 _dispatch_client_callout + 16 70 | 13 libdispatch.dylib 0x000000010111a4d8 _dispatch_continuation_pop + 588 71 | 14 libdispatch.dylib 0x0000000101118dc8 _dispatch_async_redirect_invoke + 628 72 | 15 libdispatch.dylib 0x000000010111e84c _dispatch_root_queue_drain + 604 73 | 16 libdispatch.dylib 0x000000010111e584 _dispatch_worker_thread3 + 136 74 | 17 libsystem_pthread.dylib 0x0000000181887fac _pthread_wqthread + 1176 75 | 18 libsystem_pthread.dylib 0x0000000181887b08 start_wqthread + 4 76 | 77 | 78 | In this same execution context, this is a callstack generated with Cymbol: 79 | 80 | "0 cymbalStressTestiOS 0x0000000100d44948 create_symbolicated_callstack + 152", 81 | "1 cymbalStressTestiOS 0x0000000100d44f54 cymbal_callstack + 40", 82 | "2 cymbalStressTestiOS 0x0000000100d44528 __main_block_invoke_2 + 116", 83 | "3 CFNetwork 0x00000001821f189c -[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:] + 896", 84 | "4 CFNetwork 0x000000018220a584 -[__NSCFLocalSessionTask _task_onqueue_didFinish] + 952", 85 | "5 Foundation 0x000000018268acac -[NSOperation __graphDescription:] + 476", 86 | "6 Foundation 0x00000001825cc888 -[NSBlockOperation main] + 72", 87 | "7 Foundation 0x00000001825cb95c -[__NSOperationInternal _start:] + 848", 88 | "8 libdispatch.dylib 0x000000010110d220 _dispatch_client_callout + 16", 89 | "9 libdispatch.dylib 0x0000000101119850 _dispatch_block_invoke_direct + 232", 90 | "10 libdispatch.dylib 0x000000010110d220 _dispatch_client_callout + 16", 91 | "11 libdispatch.dylib 0x0000000101119850 _dispatch_block_invoke_direct + 232", 92 | "12 libdispatch.dylib 0x0000000101119734 dispatch_block_perform + 104", 93 | "13 Foundation 0x000000018268c438 -[NSOperationQueue removeObserver:forKeyPath:] + 792", 94 | "14 libdispatch.dylib 0x000000010110d220 _dispatch_client_callout + 16", 95 | "15 libdispatch.dylib 0x000000010111a4d8 _dispatch_continuation_pop + 588", 96 | "16 libdispatch.dylib 0x0000000101118dc8 _dispatch_async_redirect_invoke + 628", 97 | "17 libdispatch.dylib 0x000000010111e84c _dispatch_root_queue_drain + 604", 98 | "18 libdispatch.dylib 0x000000010111e584 _dispatch_worker_thread3 + 136", 99 | "19 libsystem_pthread.dylib 0x0000000181887fac _pthread_wqthread + 1176", 100 | "20 libsystem_pthread.dylib 0x0000000181887b08 start_wqthread + 4" 101 | -------------------------------------------------------------------------------- /cymbal.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5F3D2CE422D2D60D005FD30E /* cymbal_api_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F3D2CE322D2D60D005FD30E /* cymbal_api_tests.m */; }; 11 | 5F41E8FC22CFD6C700400835 /* cpp_demangler_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F41E8FB22CFD6C700400835 /* cpp_demangler_tests.m */; }; 12 | 5F41E8FE22CFD99C00400835 /* image_lookup_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F41E8FD22CFD99C00400835 /* image_lookup_tests.m */; }; 13 | 5F41E90022CFDE1800400835 /* symbol_creation_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F41E8FF22CFDE1800400835 /* symbol_creation_tests.m */; }; 14 | 5F41E90222CFEAB400400835 /* symbol_storage_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F41E90122CFEAB400400835 /* symbol_storage_tests.m */; }; 15 | 5F41E90422CFF20F00400835 /* frame_lookup_cache_test.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F41E90322CFF20F00400835 /* frame_lookup_cache_test.m */; }; 16 | 5F41E90622CFF67200400835 /* callstack_creation_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F41E90522CFF67200400835 /* callstack_creation_tests.m */; }; 17 | 5F4A760B22CEE88800E3BD6C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F4A760A22CEE88800E3BD6C /* main.m */; }; 18 | 5F4A761C22CEEA1900E3BD6C /* callstack_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6F208D61BB00417B0D /* callstack_creation.c */; }; 19 | 5F4A761D22CEEA1900E3BD6C /* cpp_demangler.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D79208D61BC00417B0D /* cpp_demangler.c */; }; 20 | 5F4A761E22CEEA1900E3BD6C /* cymbal.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6B208D61BA00417B0D /* cymbal.c */; }; 21 | 5F4A761F22CEEA1900E3BD6C /* frame_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6E208D61BB00417B0D /* frame_creation.c */; }; 22 | 5F4A762022CEEA1900E3BD6C /* image_lookup.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D77208D61BB00417B0D /* image_lookup.c */; }; 23 | 5F4A762122CEEA1900E3BD6C /* frame_lookup_cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D73208D61BB00417B0D /* frame_lookup_cache.c */; }; 24 | 5F4A762222CEEA1900E3BD6C /* symbol_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D75208D61BB00417B0D /* symbol_creation.c */; }; 25 | 5F4A762322CEEA1900E3BD6C /* symbol_storage.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D70208D61BB00417B0D /* symbol_storage.c */; }; 26 | 5F4A762622CEEA3F00E3BD6C /* libcymbalMacStatic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F4A761822CEEA0200E3BD6C /* libcymbalMacStatic.a */; }; 27 | 5F4A763422CEFBAC00E3BD6C /* callstack_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6F208D61BB00417B0D /* callstack_creation.c */; }; 28 | 5F4A763522CEFBAC00E3BD6C /* cpp_demangler.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D79208D61BC00417B0D /* cpp_demangler.c */; }; 29 | 5F4A763622CEFBAC00E3BD6C /* cymbal.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6B208D61BA00417B0D /* cymbal.c */; }; 30 | 5F4A763722CEFBAC00E3BD6C /* frame_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6E208D61BB00417B0D /* frame_creation.c */; }; 31 | 5F4A763822CEFBAC00E3BD6C /* image_lookup.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D77208D61BB00417B0D /* image_lookup.c */; }; 32 | 5F4A763922CEFBAC00E3BD6C /* frame_lookup_cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D73208D61BB00417B0D /* frame_lookup_cache.c */; }; 33 | 5F4A763A22CEFBAC00E3BD6C /* symbol_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D75208D61BB00417B0D /* symbol_creation.c */; }; 34 | 5F4A763B22CEFBAC00E3BD6C /* symbol_storage.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D70208D61BB00417B0D /* symbol_storage.c */; }; 35 | 5F4A764322CF01C200E3BD6C /* libcymbalMacStatic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F4A761822CEEA0200E3BD6C /* libcymbalMacStatic.a */; }; 36 | 5F7280E31FDF66DA007B32FA /* frame_creation_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F7280E21FDF66DA007B32FA /* frame_creation_tests.m */; }; 37 | 5F87C84C22D3BBB40084677F /* callstack_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6F208D61BB00417B0D /* callstack_creation.c */; }; 38 | 5F87C84D22D3BBB40084677F /* cpp_demangler.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D79208D61BC00417B0D /* cpp_demangler.c */; }; 39 | 5F87C84E22D3BBB40084677F /* cymbal.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6B208D61BA00417B0D /* cymbal.c */; }; 40 | 5F87C84F22D3BBB40084677F /* frame_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6E208D61BB00417B0D /* frame_creation.c */; }; 41 | 5F87C85022D3BBB40084677F /* frame_lookup_cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D73208D61BB00417B0D /* frame_lookup_cache.c */; }; 42 | 5F87C85122D3BBB40084677F /* image_lookup.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D77208D61BB00417B0D /* image_lookup.c */; }; 43 | 5F87C85222D3BBB40084677F /* symbol_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D75208D61BB00417B0D /* symbol_creation.c */; }; 44 | 5F87C85322D3BBB40084677F /* symbol_storage.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D70208D61BB00417B0D /* symbol_storage.c */; }; 45 | 5FB23F8C22D3BBF000B1E294 /* callstack_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6F208D61BB00417B0D /* callstack_creation.c */; }; 46 | 5FB23F8D22D3BBF000B1E294 /* cpp_demangler.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D79208D61BC00417B0D /* cpp_demangler.c */; }; 47 | 5FB23F8E22D3BBF000B1E294 /* cymbal.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6B208D61BA00417B0D /* cymbal.c */; }; 48 | 5FB23F8F22D3BBF000B1E294 /* frame_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D6E208D61BB00417B0D /* frame_creation.c */; }; 49 | 5FB23F9022D3BBF000B1E294 /* frame_lookup_cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D73208D61BB00417B0D /* frame_lookup_cache.c */; }; 50 | 5FB23F9122D3BBF000B1E294 /* image_lookup.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D77208D61BB00417B0D /* image_lookup.c */; }; 51 | 5FB23F9222D3BBF000B1E294 /* symbol_creation.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D75208D61BB00417B0D /* symbol_creation.c */; }; 52 | 5FB23F9322D3BBF000B1E294 /* symbol_storage.c in Sources */ = {isa = PBXBuildFile; fileRef = 5FAE1D70208D61BB00417B0D /* symbol_storage.c */; }; 53 | 5FB8221F22D3C2120088E451 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5FB8221E22D3C2120088E451 /* Assets.xcassets */; }; 54 | 5FB8222522D3C2120088E451 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5FB8222422D3C2120088E451 /* main.m */; }; 55 | 5FB8222B22D3C2240088E451 /* libcymbaliOSStatic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F4A762B22CEFB9E00E3BD6C /* libcymbaliOSStatic.a */; }; 56 | /* End PBXBuildFile section */ 57 | 58 | /* Begin PBXContainerItemProxy section */ 59 | 5F4A762422CEEA3700E3BD6C /* PBXContainerItemProxy */ = { 60 | isa = PBXContainerItemProxy; 61 | containerPortal = 5F7280CB1FDF66DA007B32FA /* Project object */; 62 | proxyType = 1; 63 | remoteGlobalIDString = 5F4A761722CEEA0200E3BD6C; 64 | remoteInfo = cymbalMacStatic; 65 | }; 66 | 5F4A764522CF020400E3BD6C /* PBXContainerItemProxy */ = { 67 | isa = PBXContainerItemProxy; 68 | containerPortal = 5F7280CB1FDF66DA007B32FA /* Project object */; 69 | proxyType = 1; 70 | remoteGlobalIDString = 5F4A761722CEEA0200E3BD6C; 71 | remoteInfo = cymbalMacStatic; 72 | }; 73 | 5FB8222922D3C21D0088E451 /* PBXContainerItemProxy */ = { 74 | isa = PBXContainerItemProxy; 75 | containerPortal = 5F7280CB1FDF66DA007B32FA /* Project object */; 76 | proxyType = 1; 77 | remoteGlobalIDString = 5F4A762A22CEFB9E00E3BD6C; 78 | remoteInfo = cymbaliOSStatic; 79 | }; 80 | /* End PBXContainerItemProxy section */ 81 | 82 | /* Begin PBXCopyFilesBuildPhase section */ 83 | 5F4A760622CEE88800E3BD6C /* CopyFiles */ = { 84 | isa = PBXCopyFilesBuildPhase; 85 | buildActionMask = 2147483647; 86 | dstPath = /usr/share/man/man1/; 87 | dstSubfolderSpec = 0; 88 | files = ( 89 | ); 90 | runOnlyForDeploymentPostprocessing = 1; 91 | }; 92 | 5F4A762922CEFB9E00E3BD6C /* CopyFiles */ = { 93 | isa = PBXCopyFilesBuildPhase; 94 | buildActionMask = 2147483647; 95 | dstPath = "include/$(PRODUCT_NAME)"; 96 | dstSubfolderSpec = 16; 97 | files = ( 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | /* End PBXCopyFilesBuildPhase section */ 102 | 103 | /* Begin PBXFileReference section */ 104 | 5F3D2CE322D2D60D005FD30E /* cymbal_api_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cymbal_api_tests.m; sourceTree = ""; }; 105 | 5F41E8FB22CFD6C700400835 /* cpp_demangler_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cpp_demangler_tests.m; sourceTree = ""; }; 106 | 5F41E8FD22CFD99C00400835 /* image_lookup_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = image_lookup_tests.m; sourceTree = ""; }; 107 | 5F41E8FF22CFDE1800400835 /* symbol_creation_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = symbol_creation_tests.m; sourceTree = ""; }; 108 | 5F41E90122CFEAB400400835 /* symbol_storage_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = symbol_storage_tests.m; sourceTree = ""; }; 109 | 5F41E90322CFF20F00400835 /* frame_lookup_cache_test.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = frame_lookup_cache_test.m; sourceTree = ""; }; 110 | 5F41E90522CFF67200400835 /* callstack_creation_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = callstack_creation_tests.m; sourceTree = ""; }; 111 | 5F4A760822CEE88800E3BD6C /* cymbalStressTestMac */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = cymbalStressTestMac; sourceTree = BUILT_PRODUCTS_DIR; }; 112 | 5F4A760A22CEE88800E3BD6C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 113 | 5F4A761822CEEA0200E3BD6C /* libcymbalMacStatic.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcymbalMacStatic.a; sourceTree = BUILT_PRODUCTS_DIR; }; 114 | 5F4A762B22CEFB9E00E3BD6C /* libcymbaliOSStatic.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcymbaliOSStatic.a; sourceTree = BUILT_PRODUCTS_DIR; }; 115 | 5F7280DD1FDF66DA007B32FA /* cymbalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = cymbalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 116 | 5F7280E21FDF66DA007B32FA /* frame_creation_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = frame_creation_tests.m; sourceTree = ""; }; 117 | 5F7280E41FDF66DA007B32FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 118 | 5F87C84422D3BBA50084677F /* cymbaliOSDynamic.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = cymbaliOSDynamic.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 119 | 5F87C84722D3BBA50084677F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 120 | 5F93E00A1FEB9842009F3AEC /* libobjc.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libobjc.tbd; path = usr/lib/libobjc.tbd; sourceTree = SDKROOT; }; 121 | 5FAE1D6A208D61BA00417B0D /* cymbal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cymbal.h; sourceTree = ""; }; 122 | 5FAE1D6B208D61BA00417B0D /* cymbal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cymbal.c; sourceTree = ""; }; 123 | 5FAE1D6C208D61BA00417B0D /* frame_creation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame_creation.h; sourceTree = ""; }; 124 | 5FAE1D6D208D61BA00417B0D /* frame_lookup_cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame_lookup_cache.h; sourceTree = ""; }; 125 | 5FAE1D6E208D61BB00417B0D /* frame_creation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = frame_creation.c; sourceTree = ""; }; 126 | 5FAE1D6F208D61BB00417B0D /* callstack_creation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = callstack_creation.c; sourceTree = ""; }; 127 | 5FAE1D70208D61BB00417B0D /* symbol_storage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = symbol_storage.c; sourceTree = ""; }; 128 | 5FAE1D71208D61BB00417B0D /* symbol_storage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symbol_storage.h; sourceTree = ""; }; 129 | 5FAE1D72208D61BB00417B0D /* image_lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = image_lookup.h; sourceTree = ""; }; 130 | 5FAE1D73208D61BB00417B0D /* frame_lookup_cache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = frame_lookup_cache.c; sourceTree = ""; }; 131 | 5FAE1D74208D61BB00417B0D /* callstack_creation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = callstack_creation.h; sourceTree = ""; }; 132 | 5FAE1D75208D61BB00417B0D /* symbol_creation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = symbol_creation.c; sourceTree = ""; }; 133 | 5FAE1D76208D61BB00417B0D /* cpp_demangler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpp_demangler.h; sourceTree = ""; }; 134 | 5FAE1D77208D61BB00417B0D /* image_lookup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = image_lookup.c; sourceTree = ""; }; 135 | 5FAE1D78208D61BC00417B0D /* symbol_creation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symbol_creation.h; sourceTree = ""; }; 136 | 5FAE1D79208D61BC00417B0D /* cpp_demangler.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpp_demangler.c; sourceTree = ""; }; 137 | 5FAE1D7A208D61BC00417B0D /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 138 | 5FB23F8422D3BBE500B1E294 /* cymbalMacDynamic.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = cymbalMacDynamic.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 139 | 5FB23F8722D3BBE500B1E294 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 140 | 5FB8221322D3C2110088E451 /* cymbalStressTestiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cymbalStressTestiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 141 | 5FB8221E22D3C2120088E451 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 142 | 5FB8222322D3C2120088E451 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 143 | 5FB8222422D3C2120088E451 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 144 | /* End PBXFileReference section */ 145 | 146 | /* Begin PBXFrameworksBuildPhase section */ 147 | 5F4A760522CEE88800E3BD6C /* Frameworks */ = { 148 | isa = PBXFrameworksBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | 5F4A762622CEEA3F00E3BD6C /* libcymbalMacStatic.a in Frameworks */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | 5F4A761622CEEA0200E3BD6C /* Frameworks */ = { 156 | isa = PBXFrameworksBuildPhase; 157 | buildActionMask = 2147483647; 158 | files = ( 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | 5F4A762822CEFB9E00E3BD6C /* Frameworks */ = { 163 | isa = PBXFrameworksBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | 5F7280DA1FDF66DA007B32FA /* Frameworks */ = { 170 | isa = PBXFrameworksBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | 5F4A764322CF01C200E3BD6C /* libcymbalMacStatic.a in Frameworks */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | 5F87C84122D3BBA50084677F /* Frameworks */ = { 178 | isa = PBXFrameworksBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | 5FB23F8122D3BBE500B1E294 /* Frameworks */ = { 185 | isa = PBXFrameworksBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | 5FB8221022D3C2110088E451 /* Frameworks */ = { 192 | isa = PBXFrameworksBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 5FB8222B22D3C2240088E451 /* libcymbaliOSStatic.a in Frameworks */, 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | /* End PBXFrameworksBuildPhase section */ 200 | 201 | /* Begin PBXGroup section */ 202 | 5F4A760922CEE88800E3BD6C /* cymbalStressTestMac */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | 5F4A760A22CEE88800E3BD6C /* main.m */, 206 | ); 207 | path = cymbalStressTestMac; 208 | sourceTree = ""; 209 | }; 210 | 5F7280CA1FDF66DA007B32FA = { 211 | isa = PBXGroup; 212 | children = ( 213 | 5F7280D61FDF66DA007B32FA /* cymbal */, 214 | 5F7280E11FDF66DA007B32FA /* cymbalTests */, 215 | 5F4A760922CEE88800E3BD6C /* cymbalStressTestMac */, 216 | 5F87C84522D3BBA50084677F /* cymbaliOSDynamic */, 217 | 5FB23F8522D3BBE500B1E294 /* cymbalMacDynamic */, 218 | 5FB8221422D3C2110088E451 /* cymbalStressTestiOS */, 219 | 5F7280D51FDF66DA007B32FA /* Products */, 220 | 5F93E0091FEB9842009F3AEC /* Frameworks */, 221 | ); 222 | sourceTree = ""; 223 | }; 224 | 5F7280D51FDF66DA007B32FA /* Products */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 5F7280DD1FDF66DA007B32FA /* cymbalTests.xctest */, 228 | 5F4A760822CEE88800E3BD6C /* cymbalStressTestMac */, 229 | 5F4A761822CEEA0200E3BD6C /* libcymbalMacStatic.a */, 230 | 5F4A762B22CEFB9E00E3BD6C /* libcymbaliOSStatic.a */, 231 | 5F87C84422D3BBA50084677F /* cymbaliOSDynamic.framework */, 232 | 5FB23F8422D3BBE500B1E294 /* cymbalMacDynamic.framework */, 233 | 5FB8221322D3C2110088E451 /* cymbalStressTestiOS.app */, 234 | ); 235 | name = Products; 236 | sourceTree = ""; 237 | }; 238 | 5F7280D61FDF66DA007B32FA /* cymbal */ = { 239 | isa = PBXGroup; 240 | children = ( 241 | 5FAE1D6F208D61BB00417B0D /* callstack_creation.c */, 242 | 5FAE1D74208D61BB00417B0D /* callstack_creation.h */, 243 | 5FAE1D79208D61BC00417B0D /* cpp_demangler.c */, 244 | 5FAE1D76208D61BB00417B0D /* cpp_demangler.h */, 245 | 5FAE1D6B208D61BA00417B0D /* cymbal.c */, 246 | 5FAE1D6A208D61BA00417B0D /* cymbal.h */, 247 | 5FAE1D6E208D61BB00417B0D /* frame_creation.c */, 248 | 5FAE1D6C208D61BA00417B0D /* frame_creation.h */, 249 | 5FAE1D73208D61BB00417B0D /* frame_lookup_cache.c */, 250 | 5FAE1D6D208D61BA00417B0D /* frame_lookup_cache.h */, 251 | 5FAE1D77208D61BB00417B0D /* image_lookup.c */, 252 | 5FAE1D72208D61BB00417B0D /* image_lookup.h */, 253 | 5FAE1D7A208D61BC00417B0D /* Info.plist */, 254 | 5FAE1D75208D61BB00417B0D /* symbol_creation.c */, 255 | 5FAE1D78208D61BC00417B0D /* symbol_creation.h */, 256 | 5FAE1D70208D61BB00417B0D /* symbol_storage.c */, 257 | 5FAE1D71208D61BB00417B0D /* symbol_storage.h */, 258 | ); 259 | path = cymbal; 260 | sourceTree = ""; 261 | }; 262 | 5F7280E11FDF66DA007B32FA /* cymbalTests */ = { 263 | isa = PBXGroup; 264 | children = ( 265 | 5F7280E21FDF66DA007B32FA /* frame_creation_tests.m */, 266 | 5F41E8FB22CFD6C700400835 /* cpp_demangler_tests.m */, 267 | 5F41E8FD22CFD99C00400835 /* image_lookup_tests.m */, 268 | 5F41E8FF22CFDE1800400835 /* symbol_creation_tests.m */, 269 | 5F41E90122CFEAB400400835 /* symbol_storage_tests.m */, 270 | 5F7280E41FDF66DA007B32FA /* Info.plist */, 271 | 5F41E90322CFF20F00400835 /* frame_lookup_cache_test.m */, 272 | 5F41E90522CFF67200400835 /* callstack_creation_tests.m */, 273 | 5F3D2CE322D2D60D005FD30E /* cymbal_api_tests.m */, 274 | ); 275 | path = cymbalTests; 276 | sourceTree = ""; 277 | }; 278 | 5F87C84522D3BBA50084677F /* cymbaliOSDynamic */ = { 279 | isa = PBXGroup; 280 | children = ( 281 | 5F87C84722D3BBA50084677F /* Info.plist */, 282 | ); 283 | path = cymbaliOSDynamic; 284 | sourceTree = ""; 285 | }; 286 | 5F93E0091FEB9842009F3AEC /* Frameworks */ = { 287 | isa = PBXGroup; 288 | children = ( 289 | 5F93E00A1FEB9842009F3AEC /* libobjc.tbd */, 290 | ); 291 | name = Frameworks; 292 | sourceTree = ""; 293 | }; 294 | 5FB23F8522D3BBE500B1E294 /* cymbalMacDynamic */ = { 295 | isa = PBXGroup; 296 | children = ( 297 | 5FB23F8722D3BBE500B1E294 /* Info.plist */, 298 | ); 299 | path = cymbalMacDynamic; 300 | sourceTree = ""; 301 | }; 302 | 5FB8221422D3C2110088E451 /* cymbalStressTestiOS */ = { 303 | isa = PBXGroup; 304 | children = ( 305 | 5FB8221E22D3C2120088E451 /* Assets.xcassets */, 306 | 5FB8222322D3C2120088E451 /* Info.plist */, 307 | 5FB8222422D3C2120088E451 /* main.m */, 308 | ); 309 | path = cymbalStressTestiOS; 310 | sourceTree = ""; 311 | }; 312 | /* End PBXGroup section */ 313 | 314 | /* Begin PBXHeadersBuildPhase section */ 315 | 5F4A761422CEEA0200E3BD6C /* Headers */ = { 316 | isa = PBXHeadersBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | ); 320 | runOnlyForDeploymentPostprocessing = 0; 321 | }; 322 | 5F87C83F22D3BBA50084677F /* Headers */ = { 323 | isa = PBXHeadersBuildPhase; 324 | buildActionMask = 2147483647; 325 | files = ( 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | 5FB23F7F22D3BBE500B1E294 /* Headers */ = { 330 | isa = PBXHeadersBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXHeadersBuildPhase section */ 337 | 338 | /* Begin PBXNativeTarget section */ 339 | 5F4A760722CEE88800E3BD6C /* cymbalStressTestMac */ = { 340 | isa = PBXNativeTarget; 341 | buildConfigurationList = 5F4A760E22CEE88800E3BD6C /* Build configuration list for PBXNativeTarget "cymbalStressTestMac" */; 342 | buildPhases = ( 343 | 5F4A760422CEE88800E3BD6C /* Sources */, 344 | 5F4A760522CEE88800E3BD6C /* Frameworks */, 345 | 5F4A760622CEE88800E3BD6C /* CopyFiles */, 346 | ); 347 | buildRules = ( 348 | ); 349 | dependencies = ( 350 | 5F4A762522CEEA3700E3BD6C /* PBXTargetDependency */, 351 | ); 352 | name = cymbalStressTestMac; 353 | productName = cymbalStressTestMac; 354 | productReference = 5F4A760822CEE88800E3BD6C /* cymbalStressTestMac */; 355 | productType = "com.apple.product-type.tool"; 356 | }; 357 | 5F4A761722CEEA0200E3BD6C /* cymbalMacStatic */ = { 358 | isa = PBXNativeTarget; 359 | buildConfigurationList = 5F4A761922CEEA0200E3BD6C /* Build configuration list for PBXNativeTarget "cymbalMacStatic" */; 360 | buildPhases = ( 361 | 5F4A761422CEEA0200E3BD6C /* Headers */, 362 | 5F4A761522CEEA0200E3BD6C /* Sources */, 363 | 5F4A761622CEEA0200E3BD6C /* Frameworks */, 364 | ); 365 | buildRules = ( 366 | ); 367 | dependencies = ( 368 | ); 369 | name = cymbalMacStatic; 370 | productName = cymbalMacStatic; 371 | productReference = 5F4A761822CEEA0200E3BD6C /* libcymbalMacStatic.a */; 372 | productType = "com.apple.product-type.library.static"; 373 | }; 374 | 5F4A762A22CEFB9E00E3BD6C /* cymbaliOSStatic */ = { 375 | isa = PBXNativeTarget; 376 | buildConfigurationList = 5F4A763122CEFB9E00E3BD6C /* Build configuration list for PBXNativeTarget "cymbaliOSStatic" */; 377 | buildPhases = ( 378 | 5F4A762722CEFB9E00E3BD6C /* Sources */, 379 | 5F4A762822CEFB9E00E3BD6C /* Frameworks */, 380 | 5F4A762922CEFB9E00E3BD6C /* CopyFiles */, 381 | ); 382 | buildRules = ( 383 | ); 384 | dependencies = ( 385 | ); 386 | name = cymbaliOSStatic; 387 | productName = cymbaliOSStatic; 388 | productReference = 5F4A762B22CEFB9E00E3BD6C /* libcymbaliOSStatic.a */; 389 | productType = "com.apple.product-type.library.static"; 390 | }; 391 | 5F7280DC1FDF66DA007B32FA /* cymbalTests */ = { 392 | isa = PBXNativeTarget; 393 | buildConfigurationList = 5F7280EB1FDF66DB007B32FA /* Build configuration list for PBXNativeTarget "cymbalTests" */; 394 | buildPhases = ( 395 | 5F7280D91FDF66DA007B32FA /* Sources */, 396 | 5F7280DA1FDF66DA007B32FA /* Frameworks */, 397 | 5F7280DB1FDF66DA007B32FA /* Resources */, 398 | ); 399 | buildRules = ( 400 | ); 401 | dependencies = ( 402 | 5F4A764622CF020400E3BD6C /* PBXTargetDependency */, 403 | ); 404 | name = cymbalTests; 405 | productName = cymbalTests; 406 | productReference = 5F7280DD1FDF66DA007B32FA /* cymbalTests.xctest */; 407 | productType = "com.apple.product-type.bundle.unit-test"; 408 | }; 409 | 5F87C84322D3BBA50084677F /* cymbaliOSDynamic */ = { 410 | isa = PBXNativeTarget; 411 | buildConfigurationList = 5F87C84B22D3BBA50084677F /* Build configuration list for PBXNativeTarget "cymbaliOSDynamic" */; 412 | buildPhases = ( 413 | 5F87C83F22D3BBA50084677F /* Headers */, 414 | 5F87C84022D3BBA50084677F /* Sources */, 415 | 5F87C84122D3BBA50084677F /* Frameworks */, 416 | 5F87C84222D3BBA50084677F /* Resources */, 417 | ); 418 | buildRules = ( 419 | ); 420 | dependencies = ( 421 | ); 422 | name = cymbaliOSDynamic; 423 | productName = cymbaliOSDynamic; 424 | productReference = 5F87C84422D3BBA50084677F /* cymbaliOSDynamic.framework */; 425 | productType = "com.apple.product-type.framework"; 426 | }; 427 | 5FB23F8322D3BBE500B1E294 /* cymbalMacDynamic */ = { 428 | isa = PBXNativeTarget; 429 | buildConfigurationList = 5FB23F8B22D3BBE500B1E294 /* Build configuration list for PBXNativeTarget "cymbalMacDynamic" */; 430 | buildPhases = ( 431 | 5FB23F7F22D3BBE500B1E294 /* Headers */, 432 | 5FB23F8022D3BBE500B1E294 /* Sources */, 433 | 5FB23F8122D3BBE500B1E294 /* Frameworks */, 434 | 5FB23F8222D3BBE500B1E294 /* Resources */, 435 | ); 436 | buildRules = ( 437 | ); 438 | dependencies = ( 439 | ); 440 | name = cymbalMacDynamic; 441 | productName = cymbalMacDynamic; 442 | productReference = 5FB23F8422D3BBE500B1E294 /* cymbalMacDynamic.framework */; 443 | productType = "com.apple.product-type.framework"; 444 | }; 445 | 5FB8221222D3C2110088E451 /* cymbalStressTestiOS */ = { 446 | isa = PBXNativeTarget; 447 | buildConfigurationList = 5FB8222822D3C2120088E451 /* Build configuration list for PBXNativeTarget "cymbalStressTestiOS" */; 448 | buildPhases = ( 449 | 5FB8220F22D3C2110088E451 /* Sources */, 450 | 5FB8221022D3C2110088E451 /* Frameworks */, 451 | 5FB8221122D3C2110088E451 /* Resources */, 452 | ); 453 | buildRules = ( 454 | ); 455 | dependencies = ( 456 | 5FB8222A22D3C21D0088E451 /* PBXTargetDependency */, 457 | ); 458 | name = cymbalStressTestiOS; 459 | productName = cymbalStressTestiOS; 460 | productReference = 5FB8221322D3C2110088E451 /* cymbalStressTestiOS.app */; 461 | productType = "com.apple.product-type.application"; 462 | }; 463 | /* End PBXNativeTarget section */ 464 | 465 | /* Begin PBXProject section */ 466 | 5F7280CB1FDF66DA007B32FA /* Project object */ = { 467 | isa = PBXProject; 468 | attributes = { 469 | LastUpgradeCheck = 1100; 470 | ORGANIZATIONNAME = "Ethan Arbuckle"; 471 | TargetAttributes = { 472 | 5F4A760722CEE88800E3BD6C = { 473 | CreatedOnToolsVersion = 11.0; 474 | ProvisioningStyle = Automatic; 475 | }; 476 | 5F4A761722CEEA0200E3BD6C = { 477 | CreatedOnToolsVersion = 11.0; 478 | ProvisioningStyle = Automatic; 479 | }; 480 | 5F4A762A22CEFB9E00E3BD6C = { 481 | CreatedOnToolsVersion = 11.0; 482 | ProvisioningStyle = Automatic; 483 | }; 484 | 5F7280DC1FDF66DA007B32FA = { 485 | CreatedOnToolsVersion = 9.2; 486 | ProvisioningStyle = Automatic; 487 | }; 488 | 5F87C84322D3BBA50084677F = { 489 | CreatedOnToolsVersion = 10.1; 490 | ProvisioningStyle = Automatic; 491 | }; 492 | 5FB23F8322D3BBE500B1E294 = { 493 | CreatedOnToolsVersion = 10.1; 494 | ProvisioningStyle = Automatic; 495 | }; 496 | 5FB8221222D3C2110088E451 = { 497 | CreatedOnToolsVersion = 10.1; 498 | ProvisioningStyle = Automatic; 499 | }; 500 | }; 501 | }; 502 | buildConfigurationList = 5F7280CE1FDF66DA007B32FA /* Build configuration list for PBXProject "cymbal" */; 503 | compatibilityVersion = "Xcode 8.0"; 504 | developmentRegion = en; 505 | hasScannedForEncodings = 0; 506 | knownRegions = ( 507 | en, 508 | Base, 509 | ); 510 | mainGroup = 5F7280CA1FDF66DA007B32FA; 511 | productRefGroup = 5F7280D51FDF66DA007B32FA /* Products */; 512 | projectDirPath = ""; 513 | projectRoot = ""; 514 | targets = ( 515 | 5F7280DC1FDF66DA007B32FA /* cymbalTests */, 516 | 5F4A760722CEE88800E3BD6C /* cymbalStressTestMac */, 517 | 5F4A761722CEEA0200E3BD6C /* cymbalMacStatic */, 518 | 5F4A762A22CEFB9E00E3BD6C /* cymbaliOSStatic */, 519 | 5F87C84322D3BBA50084677F /* cymbaliOSDynamic */, 520 | 5FB23F8322D3BBE500B1E294 /* cymbalMacDynamic */, 521 | 5FB8221222D3C2110088E451 /* cymbalStressTestiOS */, 522 | ); 523 | }; 524 | /* End PBXProject section */ 525 | 526 | /* Begin PBXResourcesBuildPhase section */ 527 | 5F7280DB1FDF66DA007B32FA /* Resources */ = { 528 | isa = PBXResourcesBuildPhase; 529 | buildActionMask = 2147483647; 530 | files = ( 531 | ); 532 | runOnlyForDeploymentPostprocessing = 0; 533 | }; 534 | 5F87C84222D3BBA50084677F /* Resources */ = { 535 | isa = PBXResourcesBuildPhase; 536 | buildActionMask = 2147483647; 537 | files = ( 538 | ); 539 | runOnlyForDeploymentPostprocessing = 0; 540 | }; 541 | 5FB23F8222D3BBE500B1E294 /* Resources */ = { 542 | isa = PBXResourcesBuildPhase; 543 | buildActionMask = 2147483647; 544 | files = ( 545 | ); 546 | runOnlyForDeploymentPostprocessing = 0; 547 | }; 548 | 5FB8221122D3C2110088E451 /* Resources */ = { 549 | isa = PBXResourcesBuildPhase; 550 | buildActionMask = 2147483647; 551 | files = ( 552 | 5FB8221F22D3C2120088E451 /* Assets.xcassets in Resources */, 553 | ); 554 | runOnlyForDeploymentPostprocessing = 0; 555 | }; 556 | /* End PBXResourcesBuildPhase section */ 557 | 558 | /* Begin PBXSourcesBuildPhase section */ 559 | 5F4A760422CEE88800E3BD6C /* Sources */ = { 560 | isa = PBXSourcesBuildPhase; 561 | buildActionMask = 2147483647; 562 | files = ( 563 | 5F4A760B22CEE88800E3BD6C /* main.m in Sources */, 564 | ); 565 | runOnlyForDeploymentPostprocessing = 0; 566 | }; 567 | 5F4A761522CEEA0200E3BD6C /* Sources */ = { 568 | isa = PBXSourcesBuildPhase; 569 | buildActionMask = 2147483647; 570 | files = ( 571 | 5F4A761C22CEEA1900E3BD6C /* callstack_creation.c in Sources */, 572 | 5F4A761D22CEEA1900E3BD6C /* cpp_demangler.c in Sources */, 573 | 5F4A761E22CEEA1900E3BD6C /* cymbal.c in Sources */, 574 | 5F4A761F22CEEA1900E3BD6C /* frame_creation.c in Sources */, 575 | 5F4A762022CEEA1900E3BD6C /* image_lookup.c in Sources */, 576 | 5F4A762122CEEA1900E3BD6C /* frame_lookup_cache.c in Sources */, 577 | 5F4A762222CEEA1900E3BD6C /* symbol_creation.c in Sources */, 578 | 5F4A762322CEEA1900E3BD6C /* symbol_storage.c in Sources */, 579 | ); 580 | runOnlyForDeploymentPostprocessing = 0; 581 | }; 582 | 5F4A762722CEFB9E00E3BD6C /* Sources */ = { 583 | isa = PBXSourcesBuildPhase; 584 | buildActionMask = 2147483647; 585 | files = ( 586 | 5F4A763422CEFBAC00E3BD6C /* callstack_creation.c in Sources */, 587 | 5F4A763522CEFBAC00E3BD6C /* cpp_demangler.c in Sources */, 588 | 5F4A763622CEFBAC00E3BD6C /* cymbal.c in Sources */, 589 | 5F4A763722CEFBAC00E3BD6C /* frame_creation.c in Sources */, 590 | 5F4A763822CEFBAC00E3BD6C /* image_lookup.c in Sources */, 591 | 5F4A763922CEFBAC00E3BD6C /* frame_lookup_cache.c in Sources */, 592 | 5F4A763A22CEFBAC00E3BD6C /* symbol_creation.c in Sources */, 593 | 5F4A763B22CEFBAC00E3BD6C /* symbol_storage.c in Sources */, 594 | ); 595 | runOnlyForDeploymentPostprocessing = 0; 596 | }; 597 | 5F7280D91FDF66DA007B32FA /* Sources */ = { 598 | isa = PBXSourcesBuildPhase; 599 | buildActionMask = 2147483647; 600 | files = ( 601 | 5F3D2CE422D2D60D005FD30E /* cymbal_api_tests.m in Sources */, 602 | 5F41E8FE22CFD99C00400835 /* image_lookup_tests.m in Sources */, 603 | 5F41E90222CFEAB400400835 /* symbol_storage_tests.m in Sources */, 604 | 5F41E90622CFF67200400835 /* callstack_creation_tests.m in Sources */, 605 | 5F41E90422CFF20F00400835 /* frame_lookup_cache_test.m in Sources */, 606 | 5F7280E31FDF66DA007B32FA /* frame_creation_tests.m in Sources */, 607 | 5F41E90022CFDE1800400835 /* symbol_creation_tests.m in Sources */, 608 | 5F41E8FC22CFD6C700400835 /* cpp_demangler_tests.m in Sources */, 609 | ); 610 | runOnlyForDeploymentPostprocessing = 0; 611 | }; 612 | 5F87C84022D3BBA50084677F /* Sources */ = { 613 | isa = PBXSourcesBuildPhase; 614 | buildActionMask = 2147483647; 615 | files = ( 616 | 5F87C84C22D3BBB40084677F /* callstack_creation.c in Sources */, 617 | 5F87C84D22D3BBB40084677F /* cpp_demangler.c in Sources */, 618 | 5F87C84E22D3BBB40084677F /* cymbal.c in Sources */, 619 | 5F87C84F22D3BBB40084677F /* frame_creation.c in Sources */, 620 | 5F87C85022D3BBB40084677F /* frame_lookup_cache.c in Sources */, 621 | 5F87C85122D3BBB40084677F /* image_lookup.c in Sources */, 622 | 5F87C85222D3BBB40084677F /* symbol_creation.c in Sources */, 623 | 5F87C85322D3BBB40084677F /* symbol_storage.c in Sources */, 624 | ); 625 | runOnlyForDeploymentPostprocessing = 0; 626 | }; 627 | 5FB23F8022D3BBE500B1E294 /* Sources */ = { 628 | isa = PBXSourcesBuildPhase; 629 | buildActionMask = 2147483647; 630 | files = ( 631 | 5FB23F8C22D3BBF000B1E294 /* callstack_creation.c in Sources */, 632 | 5FB23F8D22D3BBF000B1E294 /* cpp_demangler.c in Sources */, 633 | 5FB23F8E22D3BBF000B1E294 /* cymbal.c in Sources */, 634 | 5FB23F8F22D3BBF000B1E294 /* frame_creation.c in Sources */, 635 | 5FB23F9022D3BBF000B1E294 /* frame_lookup_cache.c in Sources */, 636 | 5FB23F9122D3BBF000B1E294 /* image_lookup.c in Sources */, 637 | 5FB23F9222D3BBF000B1E294 /* symbol_creation.c in Sources */, 638 | 5FB23F9322D3BBF000B1E294 /* symbol_storage.c in Sources */, 639 | ); 640 | runOnlyForDeploymentPostprocessing = 0; 641 | }; 642 | 5FB8220F22D3C2110088E451 /* Sources */ = { 643 | isa = PBXSourcesBuildPhase; 644 | buildActionMask = 2147483647; 645 | files = ( 646 | 5FB8222522D3C2120088E451 /* main.m in Sources */, 647 | ); 648 | runOnlyForDeploymentPostprocessing = 0; 649 | }; 650 | /* End PBXSourcesBuildPhase section */ 651 | 652 | /* Begin PBXTargetDependency section */ 653 | 5F4A762522CEEA3700E3BD6C /* PBXTargetDependency */ = { 654 | isa = PBXTargetDependency; 655 | target = 5F4A761722CEEA0200E3BD6C /* cymbalMacStatic */; 656 | targetProxy = 5F4A762422CEEA3700E3BD6C /* PBXContainerItemProxy */; 657 | }; 658 | 5F4A764622CF020400E3BD6C /* PBXTargetDependency */ = { 659 | isa = PBXTargetDependency; 660 | target = 5F4A761722CEEA0200E3BD6C /* cymbalMacStatic */; 661 | targetProxy = 5F4A764522CF020400E3BD6C /* PBXContainerItemProxy */; 662 | }; 663 | 5FB8222A22D3C21D0088E451 /* PBXTargetDependency */ = { 664 | isa = PBXTargetDependency; 665 | target = 5F4A762A22CEFB9E00E3BD6C /* cymbaliOSStatic */; 666 | targetProxy = 5FB8222922D3C21D0088E451 /* PBXContainerItemProxy */; 667 | }; 668 | /* End PBXTargetDependency section */ 669 | 670 | /* Begin XCBuildConfiguration section */ 671 | 5F4A760C22CEE88800E3BD6C /* Debug */ = { 672 | isa = XCBuildConfiguration; 673 | buildSettings = { 674 | CLANG_ENABLE_OBJC_WEAK = YES; 675 | CODE_SIGN_IDENTITY = "Mac Developer"; 676 | CODE_SIGN_STYLE = Automatic; 677 | DEVELOPMENT_TEAM = 44L979X757; 678 | ENABLE_HARDENED_RUNTIME = YES; 679 | FRAMEWORK_SEARCH_PATHS = "/Users/ethanarbuckle/Library/Developer/Xcode/DerivedData/cymbal-bfarqabjsrzugfetoglhnmwlfdhh/Build/Products/Debug-iphoneos"; 680 | MACOSX_DEPLOYMENT_TARGET = 10.14; 681 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 682 | MTL_FAST_MATH = YES; 683 | OTHER_CFLAGS = "-g"; 684 | PRODUCT_NAME = "$(TARGET_NAME)"; 685 | SDKROOT = macosx; 686 | }; 687 | name = Debug; 688 | }; 689 | 5F4A760D22CEE88800E3BD6C /* Release */ = { 690 | isa = XCBuildConfiguration; 691 | buildSettings = { 692 | CLANG_ENABLE_OBJC_WEAK = YES; 693 | CODE_SIGN_IDENTITY = "Mac Developer"; 694 | CODE_SIGN_STYLE = Automatic; 695 | DEVELOPMENT_TEAM = 44L979X757; 696 | ENABLE_HARDENED_RUNTIME = YES; 697 | FRAMEWORK_SEARCH_PATHS = "/Users/ethanarbuckle/Library/Developer/Xcode/DerivedData/cymbal-bfarqabjsrzugfetoglhnmwlfdhh/Build/Products/Debug-iphoneos"; 698 | MACOSX_DEPLOYMENT_TARGET = 10.14; 699 | MTL_FAST_MATH = YES; 700 | OTHER_CFLAGS = "-g"; 701 | PRODUCT_NAME = "$(TARGET_NAME)"; 702 | SDKROOT = macosx; 703 | }; 704 | name = Release; 705 | }; 706 | 5F4A761A22CEEA0200E3BD6C /* Debug */ = { 707 | isa = XCBuildConfiguration; 708 | buildSettings = { 709 | CLANG_ENABLE_OBJC_WEAK = YES; 710 | CODE_SIGN_STYLE = Automatic; 711 | DEVELOPMENT_TEAM = B2EWK89Q2H; 712 | EXECUTABLE_PREFIX = lib; 713 | MACOSX_DEPLOYMENT_TARGET = 10.14; 714 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 715 | MTL_FAST_MATH = YES; 716 | PRODUCT_NAME = "$(TARGET_NAME)"; 717 | SDKROOT = macosx; 718 | SKIP_INSTALL = YES; 719 | }; 720 | name = Debug; 721 | }; 722 | 5F4A761B22CEEA0200E3BD6C /* Release */ = { 723 | isa = XCBuildConfiguration; 724 | buildSettings = { 725 | CLANG_ENABLE_OBJC_WEAK = YES; 726 | CODE_SIGN_STYLE = Automatic; 727 | DEVELOPMENT_TEAM = B2EWK89Q2H; 728 | EXECUTABLE_PREFIX = lib; 729 | MACOSX_DEPLOYMENT_TARGET = 10.14; 730 | MTL_FAST_MATH = YES; 731 | PRODUCT_NAME = "$(TARGET_NAME)"; 732 | SDKROOT = macosx; 733 | SKIP_INSTALL = YES; 734 | }; 735 | name = Release; 736 | }; 737 | 5F4A763222CEFB9E00E3BD6C /* Debug */ = { 738 | isa = XCBuildConfiguration; 739 | buildSettings = { 740 | CLANG_ENABLE_OBJC_WEAK = YES; 741 | CODE_SIGN_STYLE = Automatic; 742 | DEVELOPMENT_TEAM = B2EWK89Q2H; 743 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 744 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 745 | MTL_FAST_MATH = YES; 746 | OTHER_LDFLAGS = "-ObjC"; 747 | PRODUCT_NAME = "$(TARGET_NAME)"; 748 | SKIP_INSTALL = YES; 749 | SUPPORTS_UIKITFORMAC = NO; 750 | TARGETED_DEVICE_FAMILY = "1,2"; 751 | }; 752 | name = Debug; 753 | }; 754 | 5F4A763322CEFB9E00E3BD6C /* Release */ = { 755 | isa = XCBuildConfiguration; 756 | buildSettings = { 757 | CLANG_ENABLE_OBJC_WEAK = YES; 758 | CODE_SIGN_STYLE = Automatic; 759 | DEVELOPMENT_TEAM = B2EWK89Q2H; 760 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 761 | MTL_FAST_MATH = YES; 762 | OTHER_LDFLAGS = "-ObjC"; 763 | PRODUCT_NAME = "$(TARGET_NAME)"; 764 | SKIP_INSTALL = YES; 765 | SUPPORTS_UIKITFORMAC = NO; 766 | TARGETED_DEVICE_FAMILY = "1,2"; 767 | }; 768 | name = Release; 769 | }; 770 | 5F7280E61FDF66DB007B32FA /* Debug */ = { 771 | isa = XCBuildConfiguration; 772 | buildSettings = { 773 | ALWAYS_SEARCH_USER_PATHS = NO; 774 | CLANG_ANALYZER_NONNULL = YES; 775 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 776 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 777 | CLANG_CXX_LIBRARY = "libc++"; 778 | CLANG_ENABLE_MODULES = YES; 779 | CLANG_ENABLE_OBJC_ARC = YES; 780 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 781 | CLANG_WARN_BOOL_CONVERSION = YES; 782 | CLANG_WARN_COMMA = YES; 783 | CLANG_WARN_CONSTANT_CONVERSION = YES; 784 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 785 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 786 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 787 | CLANG_WARN_EMPTY_BODY = YES; 788 | CLANG_WARN_ENUM_CONVERSION = YES; 789 | CLANG_WARN_INFINITE_RECURSION = YES; 790 | CLANG_WARN_INT_CONVERSION = YES; 791 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 792 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 793 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 794 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 795 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 796 | CLANG_WARN_STRICT_PROTOTYPES = YES; 797 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 798 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 799 | CLANG_WARN_UNREACHABLE_CODE = YES; 800 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 801 | CODE_SIGN_IDENTITY = "iPhone Developer"; 802 | COPY_PHASE_STRIP = NO; 803 | CURRENT_PROJECT_VERSION = 1; 804 | DEBUG_INFORMATION_FORMAT = dwarf; 805 | ENABLE_STRICT_OBJC_MSGSEND = YES; 806 | ENABLE_TESTABILITY = YES; 807 | GCC_C_LANGUAGE_STANDARD = gnu11; 808 | GCC_DYNAMIC_NO_PIC = NO; 809 | GCC_NO_COMMON_BLOCKS = YES; 810 | GCC_OPTIMIZATION_LEVEL = 0; 811 | GCC_PREPROCESSOR_DEFINITIONS = ( 812 | "DEBUG=1", 813 | "$(inherited)", 814 | ); 815 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 816 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 817 | GCC_WARN_UNDECLARED_SELECTOR = YES; 818 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 819 | GCC_WARN_UNUSED_FUNCTION = YES; 820 | GCC_WARN_UNUSED_VARIABLE = YES; 821 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 822 | MTL_ENABLE_DEBUG_INFO = YES; 823 | ONLY_ACTIVE_ARCH = YES; 824 | SDKROOT = iphoneos; 825 | VERSIONING_SYSTEM = "apple-generic"; 826 | VERSION_INFO_PREFIX = ""; 827 | }; 828 | name = Debug; 829 | }; 830 | 5F7280E71FDF66DB007B32FA /* Release */ = { 831 | isa = XCBuildConfiguration; 832 | buildSettings = { 833 | ALWAYS_SEARCH_USER_PATHS = NO; 834 | CLANG_ANALYZER_NONNULL = YES; 835 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 836 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 837 | CLANG_CXX_LIBRARY = "libc++"; 838 | CLANG_ENABLE_MODULES = YES; 839 | CLANG_ENABLE_OBJC_ARC = YES; 840 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 841 | CLANG_WARN_BOOL_CONVERSION = YES; 842 | CLANG_WARN_COMMA = YES; 843 | CLANG_WARN_CONSTANT_CONVERSION = YES; 844 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 845 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 846 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 847 | CLANG_WARN_EMPTY_BODY = YES; 848 | CLANG_WARN_ENUM_CONVERSION = YES; 849 | CLANG_WARN_INFINITE_RECURSION = YES; 850 | CLANG_WARN_INT_CONVERSION = YES; 851 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 852 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 853 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 854 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 855 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 856 | CLANG_WARN_STRICT_PROTOTYPES = YES; 857 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 858 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 859 | CLANG_WARN_UNREACHABLE_CODE = YES; 860 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 861 | CODE_SIGN_IDENTITY = "iPhone Developer"; 862 | COPY_PHASE_STRIP = NO; 863 | CURRENT_PROJECT_VERSION = 1; 864 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 865 | ENABLE_NS_ASSERTIONS = NO; 866 | ENABLE_STRICT_OBJC_MSGSEND = YES; 867 | GCC_C_LANGUAGE_STANDARD = gnu11; 868 | GCC_NO_COMMON_BLOCKS = YES; 869 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 870 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 871 | GCC_WARN_UNDECLARED_SELECTOR = YES; 872 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 873 | GCC_WARN_UNUSED_FUNCTION = YES; 874 | GCC_WARN_UNUSED_VARIABLE = YES; 875 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 876 | MTL_ENABLE_DEBUG_INFO = NO; 877 | SDKROOT = iphoneos; 878 | VALIDATE_PRODUCT = YES; 879 | VERSIONING_SYSTEM = "apple-generic"; 880 | VERSION_INFO_PREFIX = ""; 881 | }; 882 | name = Release; 883 | }; 884 | 5F7280EC1FDF66DB007B32FA /* Debug */ = { 885 | isa = XCBuildConfiguration; 886 | buildSettings = { 887 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 888 | CODE_SIGN_STYLE = Automatic; 889 | DEVELOPMENT_TEAM = 44L979X757; 890 | INFOPLIST_FILE = cymbalTests/Info.plist; 891 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 892 | LIBRARY_SEARCH_PATHS = "/Users/ethanarbuckle/Library/Developer/Xcode/DerivedData/cymbal-bfarqabjsrzugfetoglhnmwlfdhh/Build/Products/Debug/"; 893 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbalTests; 894 | PRODUCT_NAME = "$(TARGET_NAME)"; 895 | SUPPORTS_UIKITFORMAC = NO; 896 | TARGETED_DEVICE_FAMILY = "1,2"; 897 | }; 898 | name = Debug; 899 | }; 900 | 5F7280ED1FDF66DB007B32FA /* Release */ = { 901 | isa = XCBuildConfiguration; 902 | buildSettings = { 903 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 904 | CODE_SIGN_STYLE = Automatic; 905 | DEVELOPMENT_TEAM = 44L979X757; 906 | INFOPLIST_FILE = cymbalTests/Info.plist; 907 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 908 | LIBRARY_SEARCH_PATHS = "/Users/ethanarbuckle/Library/Developer/Xcode/DerivedData/cymbal-bfarqabjsrzugfetoglhnmwlfdhh/Build/Products/Debug/"; 909 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbalTests; 910 | PRODUCT_NAME = "$(TARGET_NAME)"; 911 | SUPPORTS_UIKITFORMAC = NO; 912 | TARGETED_DEVICE_FAMILY = "1,2"; 913 | }; 914 | name = Release; 915 | }; 916 | 5F87C84922D3BBA50084677F /* Debug */ = { 917 | isa = XCBuildConfiguration; 918 | buildSettings = { 919 | CLANG_ENABLE_OBJC_WEAK = YES; 920 | CODE_SIGN_IDENTITY = ""; 921 | CODE_SIGN_STYLE = Automatic; 922 | DEFINES_MODULE = YES; 923 | DEVELOPMENT_TEAM = 44L979X757; 924 | DYLIB_COMPATIBILITY_VERSION = 1; 925 | DYLIB_CURRENT_VERSION = 1; 926 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 927 | INFOPLIST_FILE = cymbaliOSDynamic/Info.plist; 928 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 929 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 930 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 931 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 932 | MTL_FAST_MATH = YES; 933 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbaliOSDynamic; 934 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 935 | SKIP_INSTALL = YES; 936 | TARGETED_DEVICE_FAMILY = "1,2"; 937 | }; 938 | name = Debug; 939 | }; 940 | 5F87C84A22D3BBA50084677F /* Release */ = { 941 | isa = XCBuildConfiguration; 942 | buildSettings = { 943 | CLANG_ENABLE_OBJC_WEAK = YES; 944 | CODE_SIGN_IDENTITY = ""; 945 | CODE_SIGN_STYLE = Automatic; 946 | DEFINES_MODULE = YES; 947 | DEVELOPMENT_TEAM = 44L979X757; 948 | DYLIB_COMPATIBILITY_VERSION = 1; 949 | DYLIB_CURRENT_VERSION = 1; 950 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 951 | INFOPLIST_FILE = cymbaliOSDynamic/Info.plist; 952 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 953 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 954 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 955 | MTL_FAST_MATH = YES; 956 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbaliOSDynamic; 957 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 958 | SKIP_INSTALL = YES; 959 | TARGETED_DEVICE_FAMILY = "1,2"; 960 | }; 961 | name = Release; 962 | }; 963 | 5FB23F8922D3BBE500B1E294 /* Debug */ = { 964 | isa = XCBuildConfiguration; 965 | buildSettings = { 966 | CLANG_ENABLE_OBJC_WEAK = YES; 967 | CODE_SIGN_IDENTITY = "Mac Developer"; 968 | CODE_SIGN_STYLE = Automatic; 969 | COMBINE_HIDPI_IMAGES = YES; 970 | DEFINES_MODULE = YES; 971 | DEVELOPMENT_TEAM = 44L979X757; 972 | DYLIB_COMPATIBILITY_VERSION = 1; 973 | DYLIB_CURRENT_VERSION = 1; 974 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 975 | FRAMEWORK_VERSION = A; 976 | INFOPLIST_FILE = cymbalMacDynamic/Info.plist; 977 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 978 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 979 | MACOSX_DEPLOYMENT_TARGET = 10.14; 980 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 981 | MTL_FAST_MATH = YES; 982 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbalMacDynamic; 983 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 984 | SDKROOT = macosx; 985 | SKIP_INSTALL = YES; 986 | }; 987 | name = Debug; 988 | }; 989 | 5FB23F8A22D3BBE500B1E294 /* Release */ = { 990 | isa = XCBuildConfiguration; 991 | buildSettings = { 992 | CLANG_ENABLE_OBJC_WEAK = YES; 993 | CODE_SIGN_IDENTITY = "Mac Developer"; 994 | CODE_SIGN_STYLE = Automatic; 995 | COMBINE_HIDPI_IMAGES = YES; 996 | DEFINES_MODULE = YES; 997 | DEVELOPMENT_TEAM = 44L979X757; 998 | DYLIB_COMPATIBILITY_VERSION = 1; 999 | DYLIB_CURRENT_VERSION = 1; 1000 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1001 | FRAMEWORK_VERSION = A; 1002 | INFOPLIST_FILE = cymbalMacDynamic/Info.plist; 1003 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1004 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 1005 | MACOSX_DEPLOYMENT_TARGET = 10.14; 1006 | MTL_FAST_MATH = YES; 1007 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbalMacDynamic; 1008 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 1009 | SDKROOT = macosx; 1010 | SKIP_INSTALL = YES; 1011 | }; 1012 | name = Release; 1013 | }; 1014 | 5FB8222622D3C2120088E451 /* Debug */ = { 1015 | isa = XCBuildConfiguration; 1016 | buildSettings = { 1017 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1018 | CLANG_ENABLE_OBJC_WEAK = YES; 1019 | CODE_SIGN_STYLE = Automatic; 1020 | DEVELOPMENT_TEAM = 44L979X757; 1021 | INFOPLIST_FILE = cymbalStressTestiOS/Info.plist; 1022 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 1023 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1024 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1025 | MTL_FAST_MATH = YES; 1026 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbalStressTestiOS; 1027 | PRODUCT_NAME = "$(TARGET_NAME)"; 1028 | TARGETED_DEVICE_FAMILY = "1,2"; 1029 | }; 1030 | name = Debug; 1031 | }; 1032 | 5FB8222722D3C2120088E451 /* Release */ = { 1033 | isa = XCBuildConfiguration; 1034 | buildSettings = { 1035 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1036 | CLANG_ENABLE_OBJC_WEAK = YES; 1037 | CODE_SIGN_STYLE = Automatic; 1038 | DEVELOPMENT_TEAM = 44L979X757; 1039 | INFOPLIST_FILE = cymbalStressTestiOS/Info.plist; 1040 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 1041 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1042 | MTL_FAST_MATH = YES; 1043 | PRODUCT_BUNDLE_IDENTIFIER = com.ethanarbuckle.cymbalStressTestiOS; 1044 | PRODUCT_NAME = "$(TARGET_NAME)"; 1045 | TARGETED_DEVICE_FAMILY = "1,2"; 1046 | }; 1047 | name = Release; 1048 | }; 1049 | /* End XCBuildConfiguration section */ 1050 | 1051 | /* Begin XCConfigurationList section */ 1052 | 5F4A760E22CEE88800E3BD6C /* Build configuration list for PBXNativeTarget "cymbalStressTestMac" */ = { 1053 | isa = XCConfigurationList; 1054 | buildConfigurations = ( 1055 | 5F4A760C22CEE88800E3BD6C /* Debug */, 1056 | 5F4A760D22CEE88800E3BD6C /* Release */, 1057 | ); 1058 | defaultConfigurationIsVisible = 0; 1059 | defaultConfigurationName = Release; 1060 | }; 1061 | 5F4A761922CEEA0200E3BD6C /* Build configuration list for PBXNativeTarget "cymbalMacStatic" */ = { 1062 | isa = XCConfigurationList; 1063 | buildConfigurations = ( 1064 | 5F4A761A22CEEA0200E3BD6C /* Debug */, 1065 | 5F4A761B22CEEA0200E3BD6C /* Release */, 1066 | ); 1067 | defaultConfigurationIsVisible = 0; 1068 | defaultConfigurationName = Release; 1069 | }; 1070 | 5F4A763122CEFB9E00E3BD6C /* Build configuration list for PBXNativeTarget "cymbaliOSStatic" */ = { 1071 | isa = XCConfigurationList; 1072 | buildConfigurations = ( 1073 | 5F4A763222CEFB9E00E3BD6C /* Debug */, 1074 | 5F4A763322CEFB9E00E3BD6C /* Release */, 1075 | ); 1076 | defaultConfigurationIsVisible = 0; 1077 | defaultConfigurationName = Release; 1078 | }; 1079 | 5F7280CE1FDF66DA007B32FA /* Build configuration list for PBXProject "cymbal" */ = { 1080 | isa = XCConfigurationList; 1081 | buildConfigurations = ( 1082 | 5F7280E61FDF66DB007B32FA /* Debug */, 1083 | 5F7280E71FDF66DB007B32FA /* Release */, 1084 | ); 1085 | defaultConfigurationIsVisible = 0; 1086 | defaultConfigurationName = Release; 1087 | }; 1088 | 5F7280EB1FDF66DB007B32FA /* Build configuration list for PBXNativeTarget "cymbalTests" */ = { 1089 | isa = XCConfigurationList; 1090 | buildConfigurations = ( 1091 | 5F7280EC1FDF66DB007B32FA /* Debug */, 1092 | 5F7280ED1FDF66DB007B32FA /* Release */, 1093 | ); 1094 | defaultConfigurationIsVisible = 0; 1095 | defaultConfigurationName = Release; 1096 | }; 1097 | 5F87C84B22D3BBA50084677F /* Build configuration list for PBXNativeTarget "cymbaliOSDynamic" */ = { 1098 | isa = XCConfigurationList; 1099 | buildConfigurations = ( 1100 | 5F87C84922D3BBA50084677F /* Debug */, 1101 | 5F87C84A22D3BBA50084677F /* Release */, 1102 | ); 1103 | defaultConfigurationIsVisible = 0; 1104 | defaultConfigurationName = Release; 1105 | }; 1106 | 5FB23F8B22D3BBE500B1E294 /* Build configuration list for PBXNativeTarget "cymbalMacDynamic" */ = { 1107 | isa = XCConfigurationList; 1108 | buildConfigurations = ( 1109 | 5FB23F8922D3BBE500B1E294 /* Debug */, 1110 | 5FB23F8A22D3BBE500B1E294 /* Release */, 1111 | ); 1112 | defaultConfigurationIsVisible = 0; 1113 | defaultConfigurationName = Release; 1114 | }; 1115 | 5FB8222822D3C2120088E451 /* Build configuration list for PBXNativeTarget "cymbalStressTestiOS" */ = { 1116 | isa = XCConfigurationList; 1117 | buildConfigurations = ( 1118 | 5FB8222622D3C2120088E451 /* Debug */, 1119 | 5FB8222722D3C2120088E451 /* Release */, 1120 | ); 1121 | defaultConfigurationIsVisible = 0; 1122 | defaultConfigurationName = Release; 1123 | }; 1124 | /* End XCConfigurationList section */ 1125 | }; 1126 | rootObject = 5F7280CB1FDF66DA007B32FA /* Project object */; 1127 | } 1128 | -------------------------------------------------------------------------------- /cymbal.xcodeproj/xcshareddata/xcschemes/cymbalTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 16 | 17 | 19 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 46 | 47 | 49 | 50 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /cymbal/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /cymbal/callstack_creation.c: -------------------------------------------------------------------------------- 1 | // 2 | // callstack_creation.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include "frame_creation.h" 12 | 13 | #define MAX_CALLSTACK_DEPTH 128 14 | 15 | 16 | CFArrayRef create_symbolicated_callstack(int depth, int nothing_precedes_start) 17 | { 18 | CFMutableArrayRef mutable_callstack = CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL); 19 | 20 | int callstack_depth = (MAX_CALLSTACK_DEPTH > depth) ? depth : MAX_CALLSTACK_DEPTH; 21 | 22 | // Retrieve list of return addresses 23 | void *address_history[MAX_CALLSTACK_DEPTH]; 24 | backtrace(address_history, callstack_depth); 25 | 26 | for (int i = 0; i < callstack_depth; i++) 27 | { 28 | void *return_address = address_history[i]; 29 | if (return_address == NULL) 30 | { 31 | break; 32 | } 33 | 34 | // Retrieve final symbolicated frame 35 | const char *frame = symbolicated_frame_for_address(return_address); 36 | if (frame != NULL) 37 | { 38 | if (strlen(frame) >= 1) 39 | { 40 | // Add it to callstack array in CFStringRef representation 41 | CFStringRef final_frame = CFStringCreateWithFormat(kCFAllocatorDefault, 0, CFSTR("%d %s"), i, frame); 42 | CFAutorelease(final_frame); 43 | CFArrayAppendValue(mutable_callstack, final_frame); 44 | } 45 | 46 | if (nothing_precedes_start == 1) 47 | { 48 | // stop when "start() + 1" is reached 49 | if (strstr(frame, " start + 1") != NULL || strstr(frame, " start_wqthread +") != NULL) 50 | { 51 | free((void *)frame); 52 | break; 53 | } 54 | } 55 | 56 | free((void *)frame); 57 | } 58 | } 59 | 60 | CFArrayRef final_callstack = CFArrayCreateCopy(kCFAllocatorDefault, mutable_callstack); 61 | CFRelease(mutable_callstack); 62 | 63 | return final_callstack; 64 | } 65 | -------------------------------------------------------------------------------- /cymbal/callstack_creation.h: -------------------------------------------------------------------------------- 1 | // 2 | // callstack_creation.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | CFArrayRef create_symbolicated_callstack(int depth, int nothing_precedes_start); 12 | -------------------------------------------------------------------------------- /cymbal/cpp_demangler.c: -------------------------------------------------------------------------------- 1 | // 2 | // cpp_demangler.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | 12 | 13 | char *demangle_cpp_symbol(const char *mangled_symbol) { 14 | // Get a pointer to abi::__cxa_demangle function pointer 15 | static dispatch_once_t onceToken; 16 | static void *__cxa_demangle = NULL; 17 | dispatch_once(&onceToken, ^{ 18 | __cxa_demangle = dlsym(dlopen(NULL, RTLD_NOW), "__cxa_demangle"); 19 | }); 20 | 21 | if (__cxa_demangle == NULL) { 22 | return NULL; 23 | } 24 | 25 | return ((char * (*)(const char *, char *, size_t *, int *))__cxa_demangle)(mangled_symbol, NULL, NULL, NULL); 26 | } 27 | -------------------------------------------------------------------------------- /cymbal/cpp_demangler.h: -------------------------------------------------------------------------------- 1 | // 2 | // cpp_demangler.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | char *demangle_cpp_symbol(const char *mangled_symbol); 10 | -------------------------------------------------------------------------------- /cymbal/cymbal.c: -------------------------------------------------------------------------------- 1 | // 2 | // cymbal.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import "cymbal.h" 10 | #include "symbol_creation.h" 11 | #include "callstack_creation.h" 12 | #include "frame_creation.h" 13 | 14 | #pragma mark - Internal 15 | // A lookup cache for callers that will have repeat lookups of the same address. 16 | // This differs from the other symbol lookup cache because it only includes class names or function names (not image or address) 17 | static CFMutableDictionaryRef __lookup_cache(void) 18 | { 19 | static CFMutableDictionaryRef _lookup_cache; 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | _lookup_cache = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL); 23 | }); 24 | return _lookup_cache; 25 | } 26 | 27 | __attribute__((constructor)) static void _symbolicator_injected(void) { 28 | printf("cymbal starting\n"); 29 | 30 | /* All of the symbol mapping happens on this background queue. It is unideal for the app to execute code until this mapping process has completed as it could lead 31 | to failed symbolication attempts (symbolicating an address that has not yet been mapped). The main thread will freeze and wait for either to happen: 32 | 1) the mapping thread to signal that it has completed, and app execution can continue as normal. 33 | 2) the mapping operation is taking too long, and we need to unfreeze the main thread so Watchdog doesn't kill the process. 34 | When this happens the background thread continues mapping but the app becomes active. 35 | */ 36 | dispatch_async_f(_symbolication_worker_queue(), 0, &map_all_symbols); 37 | dispatch_semaphore_wait(_symbolication_mainthread_semaphore(), dispatch_time(DISPATCH_TIME_NOW, /* watchdog timeout */ 3 * NSEC_PER_SEC)); 38 | 39 | // Create Objective-c bridge to use these functions 40 | // +[Cymbal callstack] 41 | Class Cymbal = objc_allocateClassPair(objc_getClass("NSObject"), "Cymbal", 0); 42 | objc_registerClassPair(Cymbal); 43 | 44 | IMP symbolicateImp = imp_implementationWithBlock((id)^(id _self, void *address) { 45 | 46 | const char *symbol = cymbolicate(address); 47 | CFStringRef cfsymbol = CFStringCreateWithCString(kCFAllocatorDefault, symbol, kCFStringEncodingUTF8); 48 | free((void *)symbol); 49 | return cfsymbol; 50 | }); 51 | class_addMethod(objc_getMetaClass("Cymbal"), sel_registerName("symbolicate:"), symbolicateImp, "@@:Q"); 52 | 53 | IMP callstackImp = imp_implementationWithBlock((id)^(id _self) { 54 | CFArrayRef callstack = cymbal_callstack(); 55 | CFMutableArrayRef mutableCallstack = CFArrayCreateMutableCopy(kCFAllocatorDefault, 0, callstack); 56 | CFAutorelease(mutableCallstack); 57 | CFRelease(callstack); 58 | 59 | // remove the first frame because it is a Cymbal function 60 | CFArrayRemoveValueAtIndex(mutableCallstack, 0); 61 | return mutableCallstack; 62 | }); 63 | class_addMethod(objc_getMetaClass("Cymbal"), sel_registerName("callstack"), callstackImp, "@@"); 64 | 65 | // TODO: need a way to catch new classes/methods being created after launch using runtime functions. maybe need to interpose them? 66 | } 67 | 68 | #pragma mark - Public 69 | EXPORT CFArrayRef cymbal_callstack(void) { 70 | int default_callstack_length = 50; 71 | // Sometimes there are more frames available preceding start(), but I asked around and no one would find it useful 72 | int stop_at_start = 1; 73 | return create_symbolicated_callstack(default_callstack_length, stop_at_start); 74 | } 75 | 76 | EXPORT const char *cymbolicate(void *address) 77 | { 78 | struct Cymbal *symbol = (struct Cymbal *)malloc(sizeof(struct Cymbal)); 79 | if (cymbal_symbol_for_address(address, &symbol) != KERN_SUCCESS) 80 | { 81 | free(symbol); 82 | return NULL; 83 | } 84 | 85 | uint32_t max_len = 512; 86 | char *symname = (char *)malloc(max_len); 87 | if (symbol->type == cymbalTypeObjectiveC) 88 | { 89 | const char *method_type_indicator = (symbol->is_class_method) ? "+" : "-"; 90 | snprintf(symname, max_len, "%s[%s %s]", method_type_indicator, symbol->class_name, symbol->method_name); 91 | } 92 | else if (symbol->type == cymbalTypeC) 93 | { 94 | snprintf(symname, max_len, "%s", symbol->symbol_name); 95 | } 96 | 97 | free(symbol); 98 | 99 | return symname; 100 | } 101 | 102 | EXPORT int cymbal_symbol_for_address(void *address, struct Cymbal **cymbal) 103 | { 104 | struct Cymbal *return_symbol; 105 | 106 | // Before anything, check to see if this exact address has already been given to us 107 | return_symbol = (struct Cymbal *)CFDictionaryGetValue(__lookup_cache(), (const void *)address); 108 | if (return_symbol != NULL) 109 | { 110 | **cymbal = *return_symbol; 111 | return KERN_SUCCESS; 112 | } 113 | 114 | return_symbol = *cymbal; 115 | if (return_symbol == NULL) 116 | { 117 | return KERN_MEMORY_ERROR; 118 | } 119 | 120 | // Try objc first 121 | struct ObjectiveCSymbol *candidate = search_for_symbol_at_address(address); 122 | if (candidate != NULL) 123 | { 124 | return_symbol->type = cymbalTypeObjectiveC; 125 | return_symbol->class_name = candidate->class_name; 126 | return_symbol->method_name = candidate->selector_name; 127 | return_symbol->is_class_method = candidate->is_class_method; 128 | } 129 | else 130 | { 131 | // Didnt find it - fallback to generating a +callStackSymbols frame. 132 | // This doesn't always mean we're returning a redacted item; this could be a symbolicated C function or an objective-c block 133 | const char *symname = create_c_symbol_name(address); 134 | if (symname == NULL) 135 | { 136 | // Failed to create a c frame, possibly invalid address 137 | printf("failed to symbolicate 0x%llx\n", (unsigned long long)address); 138 | return KERN_FAILURE; 139 | } 140 | else 141 | { 142 | return_symbol->type = cymbalTypeC; 143 | return_symbol->symbol_name = symname; 144 | } 145 | } 146 | 147 | // Whatever our end result was, cache it so we don't need to do frame creation again 148 | struct Cymbal *cacheSymbol = malloc(sizeof(struct Cymbal)); 149 | *cacheSymbol = *return_symbol; 150 | CFDictionarySetValue(__lookup_cache(), (const void *)address, cacheSymbol); 151 | 152 | return KERN_SUCCESS; 153 | } 154 | 155 | -------------------------------------------------------------------------------- /cymbal/cymbal.h: -------------------------------------------------------------------------------- 1 | // 2 | // cymbal.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/11/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #define EXPORT __attribute__ ((visibility("default"))) 12 | 13 | typedef enum { 14 | cymbalTypeObjectiveC = 0, 15 | cymbalTypeC = 1 16 | } kCymbalType; 17 | 18 | struct Cymbal { 19 | // indicates if this is a c or objective-c symbol 20 | kCymbalType type; 21 | 22 | // for objective-c symbols 23 | const char *class_name; 24 | const char *method_name; 25 | int is_class_method; 26 | 27 | // everything else 28 | const char *symbol_name; 29 | 30 | } ; 31 | 32 | EXPORT CFArrayRef cymbal_callstack(void); 33 | EXPORT int cymbal_symbol_for_address(void *address, struct Cymbal **cymbal); 34 | EXPORT const char *cymbolicate(void *address); 35 | -------------------------------------------------------------------------------- /cymbal/frame_creation.c: -------------------------------------------------------------------------------- 1 | // 2 | // frame_creation.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include //sprintf 10 | #include //malloc 11 | #include //basename 12 | #include //strnstr 13 | #include //dladdr 14 | #include // PRIu64 15 | #import "symbol_storage.h" 16 | #import "cpp_demangler.h" 17 | #include "frame_lookup_cache.h" 18 | 19 | #define MAX_FRAME_LEN 512 20 | 21 | const char *create_objc_frame_for_symbol(struct ObjectiveCSymbol *symbol, void *address) { 22 | if (!symbol || !symbol->class_name || !symbol->selector_name || !symbol->containing_image_path) { 23 | return NULL; 24 | } 25 | 26 | char *constructed_frame = (char *)malloc(MAX_FRAME_LEN * sizeof(char)); 27 | if (constructed_frame == NULL) { 28 | return NULL; 29 | } 30 | 31 | char *image_name = basename((char *)symbol->containing_image_path); 32 | uint64_t function_return_offset = (uint64_t)address - symbol->impl_address; 33 | 34 | int written = snprintf(constructed_frame, MAX_FRAME_LEN, "%-35s 0x%016lx %s[%s %s] + %" PRIu64, 35 | image_name, 36 | (unsigned long)symbol->impl_address, 37 | symbol->is_class_method ? "+" : "-", 38 | symbol->class_name, 39 | symbol->selector_name, 40 | function_return_offset); 41 | 42 | if (written >= MAX_FRAME_LEN) { 43 | free(constructed_frame); 44 | return NULL; 45 | } 46 | 47 | return constructed_frame; 48 | } 49 | 50 | const char *create_c_symbol_name(void *address) 51 | { 52 | // Fetch info about what is at this address 53 | Dl_info frame_information; 54 | if (dladdr((const void *)address, &frame_information) == 0) { 55 | return NULL; 56 | } 57 | 58 | return frame_information.dli_sname; 59 | } 60 | 61 | const char *create_c_frame_for_address(void *address) 62 | { 63 | // Fetch info about what is at this address 64 | Dl_info frame_information; 65 | if (dladdr((const void *)address, &frame_information) == 0) 66 | { 67 | return NULL; 68 | } 69 | 70 | // Sometimes we garbage items that have populated symbol names but invalid bases. 71 | // Confirm dli_fbase is within the realm of possibilies 72 | if (frame_information.dli_fbase >= (void *)0x100000000 && frame_information.dli_sname != NULL) { 73 | // Get the executable name from the full image path 74 | char *image_name = basename((char *)frame_information.dli_fname); 75 | 76 | // Is it a mangled c++ symbol? 77 | const char *symbol_name = frame_information.dli_sname; 78 | if (symbol_name == NULL) { 79 | return NULL; 80 | } 81 | 82 | const char *demangled = NULL; 83 | if (strlen(symbol_name) >= 2 && strncmp(symbol_name, "_Z", 2) == 0) { 84 | // Demangle 85 | demangled = demangle_cpp_symbol(symbol_name); 86 | symbol_name = demangled; 87 | } 88 | 89 | // Determine offset 90 | uint64_t function_return_offset = (uint64_t)address - (uint64_t)frame_information.dli_saddr; 91 | int required_size = snprintf(NULL, 0, "%-35s 0x%016lx %s + %llu", image_name, (unsigned long)address, symbol_name, function_return_offset) + 1; 92 | 93 | char *constructed_frame = (char *)malloc(required_size * sizeof(char)); 94 | if (constructed_frame == NULL) { 95 | printf("Failed to alloc mem for frame\n"); 96 | return NULL; 97 | } 98 | 99 | snprintf(constructed_frame, required_size, "%-35s 0x%016lx %s + %llu", image_name, (unsigned long)address, symbol_name, function_return_offset); 100 | 101 | if (demangled) { 102 | free((void *)demangled); 103 | } 104 | 105 | return constructed_frame; 106 | } 107 | 108 | // Fallback to whatever dladdr returns 109 | return frame_information.dli_sname; 110 | } 111 | 112 | const char *symbolicated_frame_for_address(void *address) 113 | { 114 | // Check cache to see if frame already exists for this address 115 | const char *cached_frame = cached_frame_for_address(address); 116 | if (cached_frame != NULL && strlen(cached_frame) > 0) 117 | { 118 | return cached_frame; 119 | } 120 | 121 | /* Create a frame identical to what +callStackSymbols would give us. 122 | This can contain multiple things: 123 | * symbolicated objective-c message 124 | * 125 | * __objective-c_block 126 | 127 | If we discover a block or an already-symbolicated item (lack of ), return it without searching our own symbol cache 128 | */ 129 | const char *frame = create_c_frame_for_address(address); 130 | if (frame == NULL || strncmp(frame, "", 10) == 0) 131 | { 132 | // This is a redacted item. Attempt to generate a symbolicated frame by search symbol bank for an item closesly matching this address 133 | struct ObjectiveCSymbol *found_symbol = search_for_symbol_at_address(address); 134 | if (found_symbol != NULL) 135 | { 136 | // An objc symbol was found, throw away the first frame 137 | if (frame) 138 | { 139 | free((void *)frame); 140 | } 141 | 142 | // Generate the replacement 143 | frame = create_objc_frame_for_symbol(found_symbol, address); 144 | } 145 | } 146 | 147 | if (frame != NULL) 148 | { 149 | cache_frame_for_lookup_address(frame, address); 150 | } 151 | 152 | return frame; 153 | } 154 | -------------------------------------------------------------------------------- /cymbal/frame_creation.h: -------------------------------------------------------------------------------- 1 | // 2 | // frame_creation.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import "symbol_storage.h" 10 | 11 | const char *create_objc_frame_for_symbol(struct ObjectiveCSymbol *symbol, void *address); 12 | const char *create_c_symbol_name(void *address); 13 | const char *create_c_frame_for_address(void *address); 14 | const char *symbolicated_frame_for_address(void *address); 15 | -------------------------------------------------------------------------------- /cymbal/frame_lookup_cache.c: -------------------------------------------------------------------------------- 1 | // 2 | // frame_lookup_cache.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | 12 | // This stores "lookups", the symbolicated frame we created for an address. 13 | // Frame creation is a slow operation, so we store them in case the address is symbolicated again 14 | static CFMutableDictionaryRef _lookup_cache(void) 15 | { 16 | static CFMutableDictionaryRef __symbol_freezer; 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | __symbol_freezer = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL); 20 | }); 21 | return __symbol_freezer; 22 | } 23 | 24 | pthread_mutex_t *_lookup_cache_lock(void) 25 | { 26 | static pthread_mutex_t __lookup_cache_lock; 27 | static dispatch_once_t onceToken; 28 | dispatch_once(&onceToken, ^{ 29 | pthread_mutex_init(&__lookup_cache_lock, 0); 30 | }); 31 | return &__lookup_cache_lock; 32 | } 33 | 34 | void cache_frame_for_lookup_address(const char *frame, void *address) { 35 | // Store a copy of the pointer 36 | char *cachedptr = strdup(frame); 37 | if (cachedptr == NULL) { 38 | return; 39 | } 40 | 41 | pthread_mutex_lock(_lookup_cache_lock()); 42 | CFDictionarySetValue(_lookup_cache(), (const void *)address, cachedptr); 43 | pthread_mutex_unlock(_lookup_cache_lock()); 44 | } 45 | 46 | // This will return NULL if nothing is cached for this address 47 | const char *cached_frame_for_address(void *address) { 48 | // Thread safe fetching 49 | pthread_mutex_lock(_lookup_cache_lock()); 50 | const char *cached_frame = (const char *)CFDictionaryGetValue(_lookup_cache(), (const void *)address); 51 | pthread_mutex_unlock(_lookup_cache_lock()); 52 | 53 | if (cached_frame == NULL) { 54 | return NULL; 55 | } 56 | 57 | return strdup(cached_frame); 58 | } 59 | -------------------------------------------------------------------------------- /cymbal/frame_lookup_cache.h: -------------------------------------------------------------------------------- 1 | // 2 | // frame_lookup_cache.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | void cache_frame_for_lookup_address(const char *frame, void *address); 10 | const char *cached_frame_for_address(void *address); 11 | -------------------------------------------------------------------------------- /cymbal/image_lookup.c: -------------------------------------------------------------------------------- 1 | // 2 | // image_lookup.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include 12 | #include "symbol_creation.h" 13 | 14 | // c string from CFString (wow) 15 | const char *utf8string(CFStringRef string) 16 | { 17 | // length can like triple during conversion for some reason, CFStringGetCString will silently fail if the buffer is undersized 18 | CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8); 19 | char *buffer = (char *)malloc(length); 20 | if (buffer != NULL) { 21 | CFStringGetCString(string, buffer, length, kCFStringEncodingUTF8); 22 | } 23 | 24 | return buffer; 25 | } 26 | 27 | // Contains images that we've already encounters and mapped 28 | static CFMutableArrayRef _mapped_images(void) 29 | { 30 | static CFMutableArrayRef __mapped_images; 31 | static dispatch_once_t onceToken; 32 | dispatch_once(&onceToken, ^{ 33 | __mapped_images = CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL); 34 | }); 35 | return __mapped_images; 36 | } 37 | 38 | // Triggered when an image is added dynamically after runtime. 39 | // When first registered, dyld enumerates all loaded images and passes them to the newly registered callback (this) 40 | // This can begin before the initial symbol mapping process finishes, which would cause parallel mapping of duplicate images. To counter, this will 41 | // ignore any images passed before the initial mapping process has completed 42 | void image_added_to_runtime(const struct mach_header *mh, intptr_t vmaddr_slide) { 43 | if (initial_mapping_has_finished == 0) { 44 | return; 45 | } 46 | 47 | // If we don't already have this image mapped, map it 48 | Dl_info info; 49 | if (dladdr(mh, &info) == 0) { 50 | return; 51 | } 52 | 53 | if (!CFArrayContainsValue(_mapped_images(), CFRangeMake(0, CFArrayGetCount(_mapped_images())), info.dli_fname)) { 54 | map_symbols_from_image_at_path(info.dli_fname); 55 | 56 | // Store it so we don't remap it again accidently 57 | CFArrayAppendValue(_mapped_images(), info.dli_fname); 58 | } 59 | } 60 | 61 | // Returns a list of all loaded dependencies + application binary 62 | const char **all_loaded_images(unsigned int *count) 63 | { 64 | // Build a list of all images dyld has to offer us 65 | uint32_t image_count = _dyld_image_count(); 66 | const char **images = (const char **)calloc(image_count + 1, sizeof(char *)); 67 | if (images == NULL) { 68 | return NULL; 69 | } 70 | 71 | for (int idx = 0; idx < image_count; idx++) { 72 | const char *current_image = _dyld_get_image_name(idx); 73 | images[idx] = current_image; 74 | CFArrayAppendValue(_mapped_images(), current_image); 75 | } 76 | 77 | // Add the main application binary to the list 78 | CFURLRef bundlePath = CFBundleCopyExecutableURL(CFBundleGetMainBundle()); 79 | CFStringRef stringBundlePath = CFURLGetString(bundlePath); 80 | 81 | const char *app_path = utf8string(stringBundlePath); 82 | if (app_path) { 83 | images[*count] = app_path; 84 | CFArrayAppendValue(_mapped_images(), app_path); 85 | } 86 | 87 | CFRelease(bundlePath); 88 | 89 | *count = image_count; 90 | return images; 91 | } 92 | -------------------------------------------------------------------------------- /cymbal/image_lookup.h: -------------------------------------------------------------------------------- 1 | // 2 | // image_lookup.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | #include 9 | 10 | #ifndef image_lookup_h 11 | #define image_lookup_h 12 | 13 | void image_added_to_runtime(const struct mach_header *mh, intptr_t vmaddr_slide); 14 | const char **all_loaded_images(unsigned int *count); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /cymbal/symbol_creation.c: -------------------------------------------------------------------------------- 1 | // 2 | // symbol_mapping.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "symbol_creation.h" 11 | #import "symbol_storage.h" 12 | #import "image_lookup.h" 13 | #include 14 | 15 | int initial_mapping_has_finished; 16 | static int totalmethods = 0; 17 | static int totalclasses = 0; 18 | 19 | // Queue where all the symbolication magic happens 20 | dispatch_queue_t _symbolication_worker_queue(void) 21 | { 22 | static dispatch_queue_t __symbolication_worker_queue; 23 | static dispatch_once_t onceToken; 24 | dispatch_once(&onceToken, ^{ 25 | __symbolication_worker_queue = dispatch_queue_create("com.ethanarbuckle.symbolicator.workerqueue", DISPATCH_QUEUE_SERIAL); 26 | }); 27 | return __symbolication_worker_queue; 28 | } 29 | 30 | // Semaphore that will stop the main thread from executing (as long as we can) 31 | dispatch_semaphore_t _symbolication_mainthread_semaphore(void) 32 | { 33 | static dispatch_semaphore_t __symbolication_mainthread_semaphore; 34 | static dispatch_once_t onceToken; 35 | dispatch_once(&onceToken, ^{ 36 | __symbolication_mainthread_semaphore = dispatch_semaphore_create(0); 37 | }); 38 | return __symbolication_mainthread_semaphore; 39 | } 40 | 41 | #pragma mark - Symbol Parsing 42 | // Map all images loaded into this process. This also installs a listener for any images added after runtime 43 | void map_all_symbols(void *_context) { 44 | clock_t start, end; 45 | start = clock(); 46 | 47 | // Discover binary images and begin looking for symbols 48 | unsigned int image_count = 0; 49 | const char **discovered_images = all_loaded_images(&image_count); 50 | if (discovered_images && image_count > 0) { 51 | for (int idx = 0; idx < image_count; idx++) { 52 | map_symbols_from_image_at_path(discovered_images[idx]); 53 | } 54 | 55 | free(discovered_images); 56 | } 57 | 58 | initial_mapping_has_finished = 1; 59 | 60 | // Listen for new images added after runtime 61 | _dyld_register_func_for_add_image(&image_added_to_runtime); 62 | 63 | // We're done, let the main thread continue 64 | dispatch_semaphore_signal(_symbolication_mainthread_semaphore()); 65 | 66 | end = clock() - start; 67 | printf("mapped %d methods from %d classes in %f seconds\n", totalmethods, totalclasses, (double) end / CLOCKS_PER_SEC); 68 | } 69 | 70 | // Map every class in a given image 71 | int map_symbols_from_image_at_path(const char *image_path) { 72 | 73 | unsigned int class_count = 0; 74 | const char **class_names = objc_copyClassNamesForImage(image_path, &class_count); 75 | if (class_names == NULL || class_count < 1) { 76 | return -1; 77 | } 78 | 79 | pthread_mutex_lock(_symbol_freezer_lock()); 80 | 81 | for (int idx = 0; idx < class_count; idx++) { 82 | Class target_class = objc_getClass(class_names[idx]); 83 | map_symbols_from_class(target_class, image_path); 84 | } 85 | 86 | pthread_mutex_unlock(_symbol_freezer_lock()); 87 | 88 | free(class_names); 89 | 90 | return 0; 91 | } 92 | 93 | // Maps every method in a given class 94 | int map_symbols_from_class(Class target_class, const char *image_path) { 95 | __atomic_fetch_add(&totalclasses, 1, __ATOMIC_SEQ_CST); 96 | 97 | const char *class_name = class_getName(target_class); 98 | 99 | // Copy instance method list and map each one 100 | unsigned int instance_method_count = 0; 101 | Method *instance_methods = class_copyMethodList(target_class, &instance_method_count); 102 | 103 | for (int idx = 0; idx < instance_method_count; idx++) { 104 | Method target_instance_method = instance_methods[idx]; 105 | create_symbol_for_method(target_instance_method, NO, image_path, class_name); 106 | } 107 | 108 | // Class methods are found on the meta class object of a normal class 109 | Class meta_class = object_getClass((struct objc_object *)target_class); 110 | 111 | // Copy class method list and map 112 | unsigned int class_method_count = 0; 113 | Method *class_methods = class_copyMethodList(meta_class, &class_method_count); 114 | for (int idx = 0; idx < class_method_count; idx++) { 115 | Method target_class_method = class_methods[idx]; 116 | create_symbol_for_method(target_class_method, YES, image_path, class_name); 117 | } 118 | 119 | free(instance_methods); 120 | free(class_methods); 121 | 122 | return 0; 123 | } 124 | 125 | // Create and store a symbolicated symbol for a Method for later symbolication use 126 | int create_symbol_for_method(Method method_to_cache, BOOL is_class_method, const char *image_path, const char *class_name) { 127 | __atomic_fetch_add(&totalmethods, 1, __ATOMIC_SEQ_CST); 128 | 129 | struct ObjectiveCSymbol *current_symbol = (struct ObjectiveCSymbol *)malloc(sizeof(struct ObjectiveCSymbol)); 130 | if (current_symbol != NULL) { 131 | current_symbol->containing_image_path = image_path; 132 | current_symbol->is_class_method = (int)is_class_method; 133 | current_symbol->class_name = class_name; 134 | current_symbol->selector_name = sel_getName(method_getName(method_to_cache)); 135 | current_symbol->impl_address = (uint64_t)method_getImplementation(method_to_cache); 136 | store_symbol(current_symbol); 137 | } 138 | 139 | return 0; 140 | } 141 | -------------------------------------------------------------------------------- /cymbal/symbol_creation.h: -------------------------------------------------------------------------------- 1 | // 2 | // symbol_mapping.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #ifndef symbol_mapping_h 10 | #define symbol_mapping_h 11 | 12 | #include 13 | 14 | extern int initial_mapping_has_finished; 15 | 16 | dispatch_queue_t _symbolication_worker_queue(void); 17 | dispatch_semaphore_t _symbolication_mainthread_semaphore(void); 18 | pthread_mutex_t *_symbol_freezer_lock(void); 19 | 20 | void map_all_symbols(void *_context); // void*_context is required because this is a dispatch_async_f callback 21 | int map_symbols_from_image_at_path(const char *image_path); 22 | int map_symbols_from_class(Class target_class, const char *image_path); 23 | int create_symbol_for_method(Method method_to_cache, BOOL is_class_method, const char *image_path, const char *class_name); 24 | 25 | #endif /* symbol_mapping_h */ 26 | -------------------------------------------------------------------------------- /cymbal/symbol_storage.c: -------------------------------------------------------------------------------- 1 | // 2 | // symbol_storage.c 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include "symbol_storage.h" 12 | 13 | #pragma mark - Symbol Storage 14 | // Where every symbol we map will be stored 15 | static CFMutableDictionaryRef _symbol_freezer(void) 16 | { 17 | static CFMutableDictionaryRef __symbol_freezer; 18 | static dispatch_once_t onceToken; 19 | dispatch_once(&onceToken, ^{ 20 | __symbol_freezer = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL); 21 | }); 22 | return __symbol_freezer; 23 | } 24 | 25 | pthread_mutex_t *_symbol_freezer_lock(void) 26 | { 27 | static pthread_mutex_t __symbol_freezer_lock; 28 | static dispatch_once_t onceToken; 29 | dispatch_once(&onceToken, ^{ 30 | pthread_mutex_init(&__symbol_freezer_lock, 0); 31 | }); 32 | return &__symbol_freezer_lock; 33 | } 34 | 35 | #pragma mark - Add/fetch symbols 36 | // Store a given symbol 37 | void store_symbol(struct ObjectiveCSymbol *symbol) { 38 | CFDictionarySetValue(_symbol_freezer(), (const void *)symbol->impl_address, symbol); 39 | } 40 | 41 | // Attempt to locate a symbolicated object for a given address 42 | struct ObjectiveCSymbol *search_for_symbol_at_address(void *function_address) { 43 | 44 | struct ObjectiveCSymbol *cached_symbol = NULL; 45 | pthread_mutex_lock(_symbol_freezer_lock()); 46 | 47 | // We are given a Method's return address, however what we have stored are Method's entry point addresses 48 | // We will look for a cached symbol within "max_method_size" of the given return address 49 | int max_method_size = 8192; 50 | for (int offset = 0; offset <= max_method_size; offset++) { 51 | 52 | // Did we find something matching this address? If not substract 1 from function_address and try again 53 | if ((cached_symbol = (struct ObjectiveCSymbol *)CFDictionaryGetValue(_symbol_freezer(), (const void *)(function_address - offset))) != NULL) { 54 | break; 55 | } 56 | } 57 | 58 | pthread_mutex_unlock(_symbol_freezer_lock()); 59 | return cached_symbol; 60 | } 61 | -------------------------------------------------------------------------------- /cymbal/symbol_storage.h: -------------------------------------------------------------------------------- 1 | // 2 | // symbol_storage.h 3 | // cymbal 4 | // 5 | // Created by Ethan Arbuckle on 12/12/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | struct ObjectiveCSymbol 10 | { 11 | const char *selector_name; 12 | const char *class_name; 13 | const char *containing_image_path; 14 | uint64_t impl_address; 15 | int is_class_method; 16 | }; 17 | 18 | void store_symbol(struct ObjectiveCSymbol *symbol); 19 | struct ObjectiveCSymbol *search_for_symbol_at_address(void *function_address); 20 | -------------------------------------------------------------------------------- /cymbalMacDynamic/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2019 Ethan Arbuckle. All rights reserved. 23 | 24 | 25 | -------------------------------------------------------------------------------- /cymbalStressTestMac/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // cymbalStressTestMac 4 | // 5 | // Created by Ethan Arbuckle on 7/4/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "cymbal.h" 12 | 13 | int main(int argc, const char * argv[]) 14 | { 15 | @autoreleasepool 16 | { 17 | // Every [NSObject alloc] invocation will trigger a cymbal callstack to be created 18 | Method target = class_getClassMethod(objc_getClass("NSObject"), sel_registerName("alloc")); 19 | IMP origimp = method_getImplementation(target); 20 | IMP newimp = imp_implementationWithBlock(^void*(id a, SEL b){ 21 | 22 | CFArrayRef callstack = cymbal_callstack(); 23 | NSLog(@"cymbal: %@", callstack); 24 | CFRelease(callstack); 25 | 26 | return ((void * (*)(id, SEL))origimp)(a, b); 27 | }); 28 | method_setImplementation(target, newimp); 29 | 30 | // Create some NSObjects 31 | __unused NSString *test = [[NSString alloc] init]; 32 | [[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@"https://google.com"] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { 33 | 34 | CFRunLoopStop(CFRunLoopGetMain()); 35 | 36 | }] resume]; 37 | } 38 | 39 | CFRunLoopRun(); 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /cymbalStressTestiOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /cymbalStressTestiOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /cymbalStressTestiOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIRequiredDeviceCapabilities 24 | 25 | armv7 26 | 27 | UISupportedInterfaceOrientations 28 | 29 | UIInterfaceOrientationPortrait 30 | UIInterfaceOrientationLandscapeLeft 31 | UIInterfaceOrientationLandscapeRight 32 | 33 | UISupportedInterfaceOrientations~ipad 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationPortraitUpsideDown 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /cymbalStressTestiOS/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // cymbalStressTestiOS 4 | // 5 | // Created by Ethan Arbuckle on 7/8/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "cymbal.h" 12 | 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | 17 | // Every [NSObject alloc] invocation will trigger a cymbal callstack to be created 18 | Method target = class_getClassMethod(objc_getClass("NSObject"), sel_registerName("alloc")); 19 | IMP origimp = method_getImplementation(target); 20 | IMP newimp = imp_implementationWithBlock(^void*(id a, SEL b){ 21 | 22 | CFArrayRef callstack = cymbal_callstack(); 23 | NSLog(@"cymbal: %@", callstack); 24 | CFRelease(callstack); 25 | 26 | return ((void * (*)(id, SEL))origimp)(a, b); 27 | }); 28 | method_setImplementation(target, newimp); 29 | 30 | // Create some NSObjects 31 | __unused NSString *test = [[NSString alloc] init]; 32 | [[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@"https://google.com"] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { 33 | 34 | CFArrayRef callstack = cymbal_callstack(); 35 | NSLog(@"cymbal: %@", callstack); 36 | CFRelease(callstack); 37 | 38 | NSLog(@"%@", [NSThread callStackSymbols]); 39 | CFRunLoopStop(CFRunLoopGetMain()); 40 | 41 | }] resume]; 42 | 43 | return 0; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /cymbalTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /cymbalTests/callstack_creation_tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // callstack_creation_tests.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 7/5/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "callstack_creation.h" 11 | 12 | @interface CallstackCreationTests : XCTestCase 13 | @end 14 | 15 | @implementation CallstackCreationTests 16 | 17 | 18 | - (void)testCallstackCreationLength 19 | { 20 | // Callstack with depth of 8 21 | int stop_at_start = 0; 22 | CFArrayRef callstack = create_symbolicated_callstack(8, stop_at_start); 23 | 24 | // Contains 8 frames 25 | NSAssert(CFArrayGetCount(callstack) == 8, @"Symbolicated callstack did not contain the expected amount of frames (8)"); 26 | CFRelease(callstack); 27 | 28 | // Callstack with depth of 20 29 | callstack = create_symbolicated_callstack(20, stop_at_start); 30 | 31 | // Contains 20 frames 32 | NSAssert(CFArrayGetCount(callstack) == 20, @"Symbolicated callstack did not contain the expected amount of frames (20)"); 33 | CFRelease(callstack); 34 | 35 | // Callstack with depth of 20 and does not have to stop at start() 36 | // this is not a useful test but it executes an additional codepath (stop_at_start==1) so test anyways 37 | stop_at_start = 0; 38 | callstack = create_symbolicated_callstack(20, stop_at_start); 39 | NSAssert(CFArrayGetCount(callstack) == 20, @"Symbolicated callstack did not contain the expected amount of frames (20)"); 40 | CFRelease(callstack); 41 | } 42 | 43 | - (void)testCallstackCreationStartedWithMain 44 | { 45 | // Callstack that contains as many frames as possible 46 | // Specified that nothing should precede start() 47 | int stop_at_start = 1; 48 | CFArrayRef callstack = create_symbolicated_callstack(50, stop_at_start); 49 | CFIndex framecnt = CFArrayGetCount(callstack); 50 | 51 | // The first frame is start() 52 | CFStringRef ff = CFArrayGetValueAtIndex(callstack, framecnt - 1); 53 | NSAssert(CFStringFind(ff, CFSTR("start +"), 0).location != kCFNotFound, @"First frame in callstack was not start()"); 54 | 55 | // The second frame is main() 56 | CFStringRef sf = CFArrayGetValueAtIndex(callstack, framecnt - 2); 57 | NSAssert(CFStringFind(sf, CFSTR("main +"), 0).location != kCFNotFound, @"Second frame in callstack was not main()"); 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /cymbalTests/cpp_demangler_tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // cpp_demangler_tests.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 7/5/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "cpp_demangler.h" 11 | 12 | @interface CppDemangleTests : XCTestCase 13 | @end 14 | 15 | @implementation CppDemangleTests 16 | 17 | - (void)testDemangleCppSymbolLong 18 | { 19 | // A mangled c++ symbol is demangled 20 | const char *mangled_symbol = "___ZN5dyld320dyld_get_sdk_versionEPK11mach_header_block_invoke"; 21 | const char *demangled = demangle_cpp_symbol(mangled_symbol); 22 | 23 | // And it was demangled as expected 24 | const char *expected = "invocation function for block in dyld3::dyld_get_sdk_version(mach_header const*)"; 25 | NSAssert(strcmp(demangled, expected) == 0, @"A long c++ symbol did not correctly demangle"); 26 | } 27 | 28 | - (void)testDemangleCppSymbolShort 29 | { 30 | // A mangled c++ symbol is demangled 31 | const char *mangled_symbol = "_ZN11header_info15getHeaderInfoRWEv"; 32 | const char *demangled = demangle_cpp_symbol(mangled_symbol); 33 | 34 | // And it was demangled as expected 35 | const char *expected = "header_info::getHeaderInfoRW()"; 36 | NSAssert(strcmp(demangled, expected) == 0, @"A short c++ symbol did not correctly demangle"); 37 | } 38 | 39 | - (void)testDemangleCppSymbolInvalid 40 | { 41 | // An invalid c++ symbol is demangled 42 | const char *mangled_symbol = "______IM_A_C_FUNCTION"; 43 | const char *demangled = demangle_cpp_symbol(mangled_symbol); 44 | 45 | // And it demangled to NULL 46 | NSAssert(demangled == NULL, @"Demangling an invalid c++ symbol did not return NULL"); 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /cymbalTests/cymbal_api_tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // cymbal_api_tests.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 7/7/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "cymbal.h" 11 | #include 12 | #include 13 | 14 | @interface CymbalAPITests : XCTestCase 15 | @end 16 | 17 | int _callstack_is_valid(CFArrayRef callstack) 18 | { 19 | CFIndex framecnt = CFArrayGetCount(callstack); 20 | // Length is over 5 21 | if (framecnt < 5) 22 | { 23 | return 0; 24 | } 25 | 26 | // The first frame is start() 27 | CFStringRef ff = CFArrayGetValueAtIndex(callstack, framecnt - 1); 28 | return CFStringFind(ff, CFSTR("start +"), 0).location != kCFNotFound; 29 | } 30 | 31 | @implementation CymbalAPITests 32 | 33 | - (void)testCymbalCallstackCFunctionInvocation 34 | { 35 | // Callstack is fetched using the c function 36 | CFArrayRef callstack = cymbal_callstack(); 37 | NSAssert(_callstack_is_valid(callstack) == 1, @"cymbal_callstack() did not return a valid callstack"); 38 | } 39 | 40 | - (void)testCymbalCallstackObjcInvocation 41 | { 42 | // Callstack is fetched using the objective-c method +[Cymbal callstack] 43 | CFArrayRef callstack = ((CFArrayRef (*)(id, SEL))objc_msgSend)(objc_getClass("Cymbal"), sel_registerName("callstack")); 44 | NSAssert(_callstack_is_valid(callstack) == 1, @"+[Cymbal callstack] did not return a valid callstack"); 45 | } 46 | 47 | - (void)testCymbolicateObjcInstanceMethodSymbol 48 | { 49 | // The address of a method that appears as inside callstacks 50 | IMP redactedImp = class_getMethodImplementation(objc_getClass("NSFileManager"), sel_registerName("_processHasUbiquityContainerEntitlement")); 51 | 52 | // A symbolicated frame is created for the address 53 | const char *symbolicated_frame = cymbolicate((void *)redactedImp); 54 | 55 | // The symbolicated frame contains the plaintext (unredacted) class and method name 56 | const char *expected = "-[NSFileManager _processHasUbiquityContainerEntitlement]"; 57 | NSAssert(strstr(symbolicated_frame, expected) != NULL, @"Failed to create symbolicated frame for an objective-c instance method address"); 58 | } 59 | 60 | - (void)testCymbolicateObjcClassMethodSymbol 61 | { 62 | // The address of a method that appears as inside callstacks 63 | IMP redactedImp = class_getMethodImplementation(objc_getMetaClass("NSURLSession"), sel_registerName("sharedSession")); 64 | 65 | // A symbolicated frame is created for the address 66 | const char *symbolicated_frame = cymbolicate((void *)redactedImp); 67 | 68 | // The symbolicated frame contains the plaintext (unredacted) class and method name 69 | const char *expected = "+[NSURLSession sharedSession]"; 70 | NSAssert(strstr(symbolicated_frame, expected) != NULL, @"Failed to create symbolicated frame for an objective-c class method address"); 71 | } 72 | 73 | - (void)testCymbolicateCSymbol 74 | { 75 | // The address of open() 76 | void *open_location = dlsym(RTLD_DEFAULT, "open"); 77 | 78 | // A symbolicated frame is created for the address 79 | const char *symbolicated_frame = cymbolicate(open_location); 80 | 81 | // The symbolicated frame contains the plaintext (unredacted) class and method name 82 | const char *expected = "__open"; 83 | NSAssert(strstr(symbolicated_frame, expected) != NULL, @"Failed to create symbolicated frame for a c function address"); 84 | } 85 | 86 | - (void)testCymbolLookupObjcInstanceMethodSymbol 87 | { 88 | // The address of a method that appears as inside callstacks 89 | IMP redactedImp = class_getMethodImplementation(objc_getClass("NSFileManager"), sel_registerName("_processHasUbiquityContainerEntitlement")); 90 | 91 | // A Cymbal object is found for the address 92 | struct Cymbal *symbol = (struct Cymbal *)malloc(sizeof(struct Cymbal)); 93 | int err = cymbal_symbol_for_address((void *)redactedImp, &symbol); 94 | NSAssert(err == KERN_SUCCESS, @"Failed to lookup get Cymbal for an objective-c instance method"); 95 | 96 | // Cymbal member values are all as expected 97 | int is_valid = 0; 98 | is_valid += (strcmp(symbol->class_name, "NSFileManager") == 0); 99 | is_valid += (strcmp(symbol->method_name, "_processHasUbiquityContainerEntitlement") == 0); 100 | is_valid += (symbol->is_class_method == 0); 101 | NSAssert(is_valid == 3, @"Objective-c instance method Cymbal contained unexpected member values"); 102 | 103 | free(symbol); 104 | } 105 | 106 | - (void)testCymbolLookupObjcClassMethodSymbol 107 | { 108 | // The address of a method that appears as inside callstacks 109 | IMP redactedImp = class_getMethodImplementation(objc_getMetaClass("NSURLSession"), sel_registerName("sharedSession")); 110 | 111 | // A Cymbal object is found for the address 112 | struct Cymbal *symbol = (struct Cymbal *)malloc(sizeof(struct Cymbal)); 113 | int err = cymbal_symbol_for_address((void *)redactedImp, &symbol); 114 | NSAssert(err == KERN_SUCCESS, @"Failed to lookup get Cymbal for an objective-c class method"); 115 | 116 | // Cymbal member values are all as expected 117 | int is_valid = 0; 118 | is_valid += (strcmp(symbol->class_name, "NSURLSession") == 0); 119 | is_valid += (strcmp(symbol->method_name, "sharedSession") == 0); 120 | is_valid += (symbol->is_class_method == 1); 121 | NSAssert(is_valid == 3, @"Objective-c class method Cymbal contained unexpected member values"); 122 | 123 | free(symbol); 124 | } 125 | 126 | - (void)testCymbolLookupCSymbol 127 | { 128 | // The address of open() 129 | void *open_location = dlsym(RTLD_DEFAULT, "open"); 130 | 131 | // A Cymbal object is found for the address 132 | struct Cymbal *symbol = (struct Cymbal *)malloc(sizeof(struct Cymbal)); 133 | int err = cymbal_symbol_for_address(open_location, &symbol); 134 | NSAssert(err == KERN_SUCCESS, @"Failed to lookup get Cymbal for a c function"); 135 | 136 | // Cymbal symbol_name is "__open" 137 | NSAssert(strcmp(symbol->symbol_name, "__open") == 0, @"C function Cymbal contained unexpected member values"); 138 | 139 | free(symbol); 140 | } 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /cymbalTests/frame_creation_tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // cymbalTests.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 12/11/17. 6 | // Copyright © 2017 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "frame_creation.h" 11 | #include 12 | #include 13 | 14 | 15 | @interface FrameCreationTests : XCTestCase 16 | @end 17 | 18 | @implementation FrameCreationTests 19 | 20 | - (void)testObjcInstanceMethodFrameCreation 21 | { 22 | // An objective-c instance method 23 | struct ObjectiveCSymbol *test_symbol = malloc(sizeof(struct ObjectiveCSymbol)); 24 | test_symbol->selector_name = "exampleMethod"; 25 | test_symbol->class_name = "exampleClass"; 26 | test_symbol->containing_image_path = "exampleImagePath"; 27 | test_symbol->impl_address = 0; 28 | test_symbol->is_class_method = 0; 29 | 30 | // A frame is created 31 | const char *frame = create_objc_frame_for_symbol(test_symbol, 0); 32 | 33 | // And the frame meets expectations 34 | const char *expected = "exampleImagePath 0x0000000000000000 -[exampleClass exampleMethod] + 0"; 35 | NSAssert(strcmp(frame, expected) == 0, @"failed to create frame for an objective-c instance method"); 36 | 37 | free((void *)frame); 38 | } 39 | 40 | - (void)testObjcClassMethodFrameCreation 41 | { 42 | // An objective-c class method 43 | struct ObjectiveCSymbol *test_symbol = malloc(sizeof(struct ObjectiveCSymbol)); 44 | test_symbol->selector_name = "exampleMethod"; 45 | test_symbol->class_name = "exampleClass"; 46 | test_symbol->containing_image_path = "exampleImagePath"; 47 | test_symbol->impl_address = 0; 48 | test_symbol->is_class_method = 1; 49 | 50 | // A frame is created 51 | const char *frame = create_objc_frame_for_symbol(test_symbol, 0); 52 | 53 | free(test_symbol); 54 | 55 | // And the frame meets expectations 56 | const char *expected = "exampleImagePath 0x0000000000000000 +[exampleClass exampleMethod] + 0"; 57 | NSAssert(strcmp(frame, expected) == 0, @"failed to create frame for an objective-c class method"); 58 | 59 | free((void *)frame); 60 | } 61 | 62 | - (void)testCSymbolFetching 63 | { 64 | // The address of open() 65 | void *open_location = dlsym(RTLD_DEFAULT, "open"); 66 | 67 | // Find the symbol name at the address 68 | const char *symbol = create_c_symbol_name(open_location); 69 | 70 | // It is "__open" 71 | NSAssert(strcmp(symbol, "__open") == 0, @"failed to fetch the symbol name of a c function"); 72 | } 73 | 74 | - (void)testCFrameCreation 75 | { 76 | // The address of open() 77 | void *open_location = dlsym(RTLD_DEFAULT, "open"); 78 | 79 | // Find the symbol name at the address 80 | const char *frame = create_c_frame_for_address(open_location); 81 | 82 | NSString *expected = @"libsystem_kernel.dylib placeholder __open + 0"; 83 | expected = [expected stringByReplacingOccurrencesOfString:@"placeholder" withString:[NSString stringWithFormat:@"0x%016llx", (unsigned long long)open_location]]; 84 | 85 | // It is "__open" 86 | NSAssert(strcmp(frame, expected.UTF8String) == 0, @"failed to fetch the symbol name of a c function"); 87 | } 88 | 89 | - (void)testSymbolicatedFrameForAddressObjc 90 | { 91 | // The address of a method that appears as inside callstacks 92 | IMP redactedImp = class_getMethodImplementation(objc_getClass("NSFileManager"), sel_registerName("_processHasUbiquityContainerEntitlement")); 93 | 94 | // A symbolicated frame is created for the address 95 | const char *symbolicated_frame = symbolicated_frame_for_address((void *)redactedImp); 96 | 97 | // The symbolicated frame contains the plaintext (unredacted) class and method name 98 | const char *expected = "-[NSFileManager _processHasUbiquityContainerEntitlement]"; 99 | NSAssert(strstr(symbolicated_frame, expected) != NULL, @"Failed to create symbolicated frame for an objective-c method address"); 100 | } 101 | 102 | - (void)testSymbolicatedFrameForAddressC 103 | { 104 | // The address of open() 105 | void *open_location = dlsym(RTLD_DEFAULT, "open"); 106 | 107 | // A symbolicated frame is created for the address 108 | const char *symbolicated_frame = symbolicated_frame_for_address(open_location); 109 | 110 | // The symbolicated frame contains the plaintext (unredacted) class and method name 111 | const char *expected = "__open + 0"; 112 | NSAssert(strstr(symbolicated_frame, expected) != NULL, @"Failed to create symbolicated frame for a c function address"); 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /cymbalTests/frame_lookup_cache_test.m: -------------------------------------------------------------------------------- 1 | // 2 | // test_frame_lookup_cache.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 7/5/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "frame_lookup_cache.h" 11 | #include "frame_creation.h" 12 | #include 13 | 14 | @interface LookupCacheTests : XCTestCase 15 | @end 16 | 17 | @implementation LookupCacheTests 18 | 19 | - (void)testFrameStorageRetrieval 20 | { 21 | // A frame is generated 22 | const char *frame_to_cache = "libsystem_kernel.dylib 0x0000000106b2e1c4 __open + 0x00"; 23 | void *address = (void *)0x00badf100d; 24 | 25 | // And stored in the cache 26 | cache_frame_for_lookup_address(frame_to_cache, address); 27 | 28 | // And then the cached frame is queried 29 | const char *cached_frame = cached_frame_for_address(address); 30 | 31 | // And it matches what was supplied into the cache 32 | NSString *a = [NSString stringWithUTF8String:frame_to_cache]; 33 | NSString *b = [NSString stringWithUTF8String:cached_frame]; 34 | NSAssert([a isEqualToString:b], @"The frame returned from the lookup cache did not match what was stored"); 35 | } 36 | 37 | - (void)testFrameCreationUsedCachedFrame 38 | { 39 | // An address is symbolicated 40 | void *address = dlsym(RTLD_DEFAULT, "open"); 41 | const char *symbolicated = symbolicated_frame_for_address(address); 42 | NSAssert(strstr(symbolicated, "__open") != NULL, @"Pre-cache frame is not the expected value"); 43 | free((void *)symbolicated); 44 | 45 | // Replace the cached frame with a fake value 46 | const char *cachedvalue = "cached frame"; 47 | cache_frame_for_lookup_address(cachedvalue, address); 48 | 49 | // The same address is symbolicated again 50 | symbolicated = symbolicated_frame_for_address(address); 51 | 52 | // The faked cache entry was returned 53 | NSAssert(strcmp(symbolicated, cachedvalue) == 0, @"Post-cache frame is not the expected value"); 54 | free((void *)symbolicated); 55 | } 56 | 57 | - (void)testFrameCreationCachedFrame 58 | { 59 | // An address to symbolicate 60 | void *address = dlsym(RTLD_DEFAULT, "close"); 61 | 62 | // And its not already cached 63 | NSAssert(cached_frame_for_address(address) == NULL, @"Cache already contains an entry for test function"); 64 | 65 | // Is symbolicated 66 | const char *symbolicated = symbolicated_frame_for_address(address); 67 | NSAssert(strstr(symbolicated, "close +") != NULL, @"Pre-cache frame is not the expected value"); 68 | free((void *)symbolicated); 69 | 70 | // And it added the frame to the cache 71 | NSAssert(cached_frame_for_address(address) != NULL, @"Frame did not get added to the lookup cache"); 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /cymbalTests/image_lookup_tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // image_lookup_tests.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 7/5/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "image_lookup.h" 11 | #include 12 | 13 | @interface ImageLookupTests : XCTestCase 14 | @end 15 | 16 | @implementation ImageLookupTests 17 | 18 | - (void)testNewImageAddedToRuntimeDetection 19 | { 20 | // The number of images that Cymbal is currently aware of 21 | unsigned int current_image_count = 0; 22 | all_loaded_images(¤t_image_count); 23 | 24 | // A new library is linked 25 | dlopen("/System/Library/Frameworks/AdSupport.framework/AdSupport", 0); 26 | 27 | // The number of images Cymbal is now aware of 28 | unsigned int new_image_count = 0; 29 | all_loaded_images(&new_image_count); 30 | 31 | // The new image(s) were detected and mapped 32 | NSAssert(new_image_count > current_image_count, @"Did not detect new images being added to the runtime"); 33 | } 34 | 35 | - (void)testSystemImagesWereDetected 36 | { 37 | // Get all mapped images from Cymbal 38 | unsigned int image_count = 0; 39 | const char **loaded_images = all_loaded_images(&image_count); 40 | 41 | // It contains entries 42 | NSAssert(image_count > 100, @"No images were mapped"); 43 | 44 | int discovered_expected_images = 0; 45 | NSArray *expectedImages = @[@"AssertionServices", @"CoreSymbolication", @"libsystem_pthread.dylib"]; 46 | for (NSString *expectedImage in expectedImages) 47 | { 48 | for (int i = 0; i < image_count; i++) 49 | { 50 | const char *curimg = loaded_images[i]; 51 | if (strstr(curimg, [expectedImage UTF8String]) != NULL) 52 | { 53 | discovered_expected_images++; 54 | } 55 | } 56 | } 57 | 58 | // All expected system images were mapped 59 | NSAssert(discovered_expected_images == [expectedImages count], @"Did not map all expected system images"); 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /cymbalTests/symbol_creation_tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // test_symbol_creation.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 7/5/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "symbol_creation.h" 11 | #include "symbol_storage.h" 12 | #include 13 | 14 | @interface SymbolCreationTests : XCTestCase 15 | @end 16 | 17 | @implementation SymbolCreationTests 18 | 19 | - (void)testCreateSymbolForInstanceMethod 20 | { 21 | // A new method is added to the runtime that Cymbal does not know about 22 | IMP newMethodImp = imp_implementationWithBlock(^void(id _self, SEL __cmd){}); 23 | SEL newMethodName = sel_registerName("testNewInstanceMethod"); 24 | class_addMethod([self class], newMethodName, newMethodImp, "v@:"); 25 | Method newMethod = class_getInstanceMethod([self class], newMethodName); 26 | 27 | // Symbol creation for the new method 28 | const char *test_image_path = "/System/Library/Some/Image/Path.framework/Path"; 29 | create_symbol_for_method(newMethod, 0, test_image_path, class_getName([self class])); 30 | 31 | // The new symbol now appears in searches 32 | struct ObjectiveCSymbol *found = search_for_symbol_at_address((void *)newMethodImp); 33 | NSAssert(found != NULL, @"Failed to create a symbol from an objective-c instance method"); 34 | 35 | // The returned information is as expected 36 | NSAssert(strcmp(found->containing_image_path, test_image_path) == 0, @"The returned symbol has an unexpected image_path"); 37 | NSAssert(found->is_class_method == 0, @"The returned symbol has an unexpected class_method"); 38 | NSAssert(strcmp(found->class_name, class_getName([self class])) == 0, @"The returned symbol has an unexpected class_name"); 39 | NSAssert(strcmp(found->selector_name, sel_getName(newMethodName)) == 0, @"The returned symbol has an unexpected selector_name"); 40 | } 41 | 42 | - (void)testCreateSymbolForClassMethod 43 | { 44 | // A new method is added to the runtime that Cymbal does not know about 45 | Class metaself = objc_getMetaClass(class_getName([self class])); 46 | IMP newMethodImp = imp_implementationWithBlock(^void(id _self, SEL __cmd){}); 47 | SEL newMethodName = sel_registerName("testNewClassMethod"); 48 | class_addMethod(metaself, newMethodName, newMethodImp, "v@:"); 49 | Method newMethod = class_getClassMethod(metaself, newMethodName); 50 | 51 | // Symbol creation for the new method 52 | const char *test_image_path = "/System/Library/Some/Image/Path.framework/Path"; 53 | create_symbol_for_method(newMethod, 1, test_image_path, class_getName([self class])); 54 | 55 | // The new symbol now appears in searches 56 | struct ObjectiveCSymbol *found = search_for_symbol_at_address((void *)newMethodImp); 57 | NSAssert(found != NULL, @"Failed to create a symbol from an objective-c method"); 58 | 59 | // The returned information is as expected 60 | NSAssert(strcmp(found->containing_image_path, test_image_path) == 0, @"The returned symbol has an unexpected image_path"); 61 | NSAssert(found->is_class_method == 1, @"The returned symbol has an unexpected class_method"); 62 | NSAssert(strcmp(found->class_name, class_getName([self class])) == 0, @"The returned symbol has an unexpected class_name"); 63 | NSAssert(strcmp(found->selector_name, sel_getName(newMethodName)) == 0, @"The returned symbol has an unexpected selector_name"); 64 | } 65 | 66 | - (void)testMapSymbolsFromClass 67 | { 68 | // New methods are added to the runtime that Cymbal does not know about 69 | IMP newMethodImp_A = imp_implementationWithBlock(^void(id _self, SEL __cmd){}); 70 | SEL newMethodName_A = sel_registerName("testNewMethodA"); 71 | class_addMethod([self class], newMethodName_A, newMethodImp_A, "v@:"); 72 | // Another new method 73 | IMP newMethodImp_B = imp_implementationWithBlock(^void(id _self, SEL __cmd){}); 74 | SEL newMethodName_B = sel_registerName("testNewMethodB"); 75 | class_addMethod([self class], newMethodName_B, newMethodImp_B, "v@:"); 76 | 77 | // Symbol creation for the Method's containing class 78 | const char *test_image_path = "/System/Library/Some/Image/Path.framework/Path"; 79 | map_symbols_from_class([self class], test_image_path); 80 | 81 | // The new symbols now appear in searches 82 | struct ObjectiveCSymbol *foundA = search_for_symbol_at_address((void *)newMethodImp_A); 83 | struct ObjectiveCSymbol *foundB = search_for_symbol_at_address((void *)newMethodImp_B); 84 | NSAssert(foundA != NULL, @"Failed to create symbol A from an objective-c class"); 85 | NSAssert(foundB != NULL, @"Failed to create symbol B from an objective-c class"); 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /cymbalTests/symbol_storage_tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // symbol_storage_tests.m 3 | // cymbalTests 4 | // 5 | // Created by Ethan Arbuckle on 7/5/19. 6 | // Copyright © 2019 Ethan Arbuckle. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "symbol_storage.h" 11 | #include 12 | 13 | @interface SymbolStorageTests : XCTestCase 14 | @end 15 | 16 | @implementation SymbolStorageTests 17 | 18 | - (void)testSymbolStorage 19 | { 20 | // An objective-c symbol 21 | const char *class = "EATestClassName"; 22 | const char *selector = "test_method"; 23 | void *address = (void *)0x0000badf100d; 24 | 25 | struct ObjectiveCSymbol *symbol = malloc(sizeof(struct ObjectiveCSymbol)); 26 | symbol->class_name = class; 27 | symbol->selector_name = selector; 28 | symbol->impl_address = (uint64_t)address; 29 | symbol->is_class_method = 0; 30 | 31 | // Is stored in the symbol storage 32 | store_symbol(symbol); 33 | 34 | // And is now searchable 35 | struct ObjectiveCSymbol *found = search_for_symbol_at_address(address); 36 | NSAssert(found != NULL, @"Failed to store and retrieve an objective-c symbol"); 37 | 38 | free(symbol); 39 | } 40 | 41 | - (void)testFuzzySearchForSymbolWithinBoundary 42 | { 43 | // An objective-c symbol 44 | const char *class = "EATestClassNameB"; 45 | const char *selector = "test_method_fuzzy"; 46 | void *address = (void *)0x0000badf00d; 47 | 48 | struct ObjectiveCSymbol *symbol = malloc(sizeof(struct ObjectiveCSymbol)); 49 | symbol->class_name = class; 50 | symbol->selector_name = selector; 51 | symbol->impl_address = (uint64_t)address; 52 | symbol->is_class_method = 0; 53 | 54 | // Is stored in the symbol storage 55 | store_symbol(symbol); 56 | 57 | // And we get a return address that is 8k bytes down the stack 58 | void *ret_address = address + 8000; 59 | 60 | // The return address can be used to find the symbol 61 | struct ObjectiveCSymbol *found = search_for_symbol_at_address(ret_address); 62 | NSAssert(found != NULL, @"Failed to store and retrieve an objective-c symbol with a fuzzy return address"); 63 | 64 | free(symbol); 65 | } 66 | 67 | - (void)testFuzzySearchForSymbolOutsideOfBoundaryAfter 68 | { 69 | // An objective-c symbol 70 | const char *class = "EATestClassNameC"; 71 | const char *selector = "test_method_fuzzy_outside"; 72 | void *address = (void *)0x00badd00df00d; 73 | 74 | struct ObjectiveCSymbol *symbol = malloc(sizeof(struct ObjectiveCSymbol)); 75 | symbol->class_name = class; 76 | symbol->selector_name = selector; 77 | symbol->impl_address = (uint64_t)address; 78 | symbol->is_class_method = 0; 79 | 80 | // Is stored in the symbol storage 81 | store_symbol(symbol); 82 | 83 | // And we get a return address that is 10k bytes down the stack (into the next function boundary) 84 | void *ret_address = address + 10000; 85 | 86 | // The return address does not find a symbol 87 | struct ObjectiveCSymbol *found = search_for_symbol_at_address(ret_address); 88 | NSAssert(found == NULL, @"Failed to store and retrieve an objective-c symbol with a fuzzy return address"); 89 | 90 | free(symbol); 91 | } 92 | 93 | - (void)testFuzzySearchForSymbolOutsideOfBoundaryBefore 94 | { 95 | // An objective-c symbol 96 | const char *class = "EATestClassNameC"; 97 | const char *selector = "test_method_fuzzy_outside"; 98 | void *address = (void *)0x00badd00df00d; 99 | 100 | struct ObjectiveCSymbol *symbol = malloc(sizeof(struct ObjectiveCSymbol)); 101 | symbol->class_name = class; 102 | symbol->selector_name = selector; 103 | symbol->impl_address = (uint64_t)address; 104 | symbol->is_class_method = 0; 105 | 106 | // Is stored in the symbol storage 107 | store_symbol(symbol); 108 | 109 | // And we get a return address that is 10k bytes before the target entry point 110 | void *ret_address = address - 10000; 111 | 112 | // The return address does not find a symbol 113 | struct ObjectiveCSymbol *found = search_for_symbol_at_address(ret_address); 114 | NSAssert(found == NULL, @"Failed to store and retrieve an objective-c symbol with a fuzzy return address"); 115 | 116 | free(symbol); 117 | } 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /cymbaliOSDynamic/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /cymbaltweak/Makefile: -------------------------------------------------------------------------------- 1 | ARCHS = arm64 arm64e 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | TWEAK_NAME = cymbalTweak 6 | cymbalTweak_FILES = $(wildcard ../cymbal/*c) Tweak.x 7 | cymbalTweak_CFLAGS = -I../cymbal/ 8 | 9 | include $(THEOS_MAKE_PATH)/tweak.mk 10 | -------------------------------------------------------------------------------- /cymbaltweak/Tweak.x: -------------------------------------------------------------------------------- 1 | %config(generator=internal); 2 | 3 | #include "cymbal.h" 4 | 5 | %hook NSThread 6 | 7 | + (id)callStackSymbols 8 | { 9 | return (NSArray *)cymbal_callstack(); 10 | } 11 | 12 | %end -------------------------------------------------------------------------------- /cymbaltweak/control: -------------------------------------------------------------------------------- 1 | Package: com.ethanarbuckle.cymbaltweak 2 | Name: cymbalTweak 3 | Depends: mobilesubstrate 4 | Version: 1.0.0 5 | Architecture: iphoneos-arm 6 | Description: Replace +[NSThread callStackSymbols] with Cymbal's unredacted implementation 7 | Maintainer: Ethan Arbuckle 8 | Author: Ethan Arbuckle 9 | Section: Tweaks 10 | -------------------------------------------------------------------------------- /cymbaltweak/cymbalTweak.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.UIKit" ); }; } 2 | -------------------------------------------------------------------------------- /cymbaltweak/packages/com.ethanarbuckle.cymbaltweak_1.0.0-1+debug_iphoneos-arm.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EthanArbuckle/cymbal/4e950e576c73d4f8b0d6bf880fc83c37fb3614a6/cymbaltweak/packages/com.ethanarbuckle.cymbaltweak_1.0.0-1+debug_iphoneos-arm.deb --------------------------------------------------------------------------------