讓crash文件中的內存地址變成函數名稱,

假如程序員編譯了inhouse給測試。

如果在測試過程中出現奔潰現象,我想程序員一般會來看Device Log 也就是?crash文件

如果crash文件遇到如下的情況,在重要的地方看不到函數名稱。我想是一件很奔潰的事情。

 1 Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
 2 Exception Codes: KERN_INVALID_ADDRESS at 0x00000000
 3 Crashed Thread:  0
 4  
 5 Thread 0 name:  Dispatch queue: com.apple.main-thread
 6 Thread 0 Crashed:
 7 0   libsystem_c.dylib                 0x37c0fe54 strlen + 12
 8 1   libstdc++.6.dylib                 0x38202410 std::string::operator=(char const*) + 8
 9 2   FishingJoy                        0x003423a0 0x1000 + 3412896
10 3   FishingJoy                        0x00342b90 0x1000 + 3414928
11 4   FishingJoy                        0x002fb3e0 0x1000 + 3122144
12 5   FishingJoy                        0x002fae3c 0x1000 + 3120700
13 6   CoreFoundation                    0x380b4224 -[NSObject performSelector:withObject:] + 36
14 7   FishingJoy                        0x002d5614 0x1000 + 2967060
15 8   CoreFoundation                    0x380b4224 -[NSObject performSelector:withObject:] + 36
16 9   Foundation                        0x3548e750 __NSThreadPerformPerform + 344
17 10  CoreFoundation                    0x38129afc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
18 11  CoreFoundation                    0x3812935e __CFRunLoopDoSources0 + 358
19 12  CoreFoundation                    0x3812806e __CFRunLoopRun + 646
20 13  CoreFoundation                    0x380ab4d6 CFRunLoopRunSpecific + 294
21 14  CoreFoundation                    0x380ab39e CFRunLoopRunInMode + 98
22 15  GraphicsServices                  0x37e82fc6 GSEventRunModal + 150
23 16  UIKit                             0x31c2b73c UIApplicationMain + 1084
24 17  FishingJoy                        0x0000389c 0x1000 + 10396
25 18  FishingJoy                        0x0000383c 0x1000 + 10300

其實我們可以還原出函數名稱,現在需要軟件“symbolicatecrash”(點擊下載)和編譯這臺inhouse的電腦。

1、先下載symbolicatecrash,放入一個干凈的目錄下。順便把crash文件也拖入此目錄。

2、先把app文件給弄出來,步驟Xcode -> Window -> Organizer?->?Archives -> 右擊給測試的包->“Show in Finder”->“顯示包內容”->復制目錄“Products/Applications/”下面的.app到 symbolicatecrash同級目錄下。

3、打開終端(terminal)首先把symbolicatecrash拖入終端,現在終端會顯示symbolicatecrash的地址并在末尾加入空格,不要回車然后依次把crash和app都拖入終端。

現在終端應該是(我在這里因為舉例,先去掉絕對目錄地址。大家看到的應該是一堆):

symbolicatecrash ?a.crash ?a.app

在末尾加入輸出地址:

symbolicatecrash ?a.crash ?a.app ?> ?b.crash ?回車。

現在去輸出地址看?b.crash,應該已經成功顯示函數名稱了。

(非常重要的一點就是 symbolicatecrash 必須和編譯該應用的XCode相匹配,可在Xcode包內找到:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash)

 1 Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
 2 Exception Codes: KERN_INVALID_ADDRESS at 0x00000000
 3 Crashed Thread:  0
 4  
 5 Thread 0 name:  Dispatch queue: com.apple.main-thread
 6 Thread 0 Crashed:
 7 0   libsystem_c.dylib                 0x37c0fe54 strlen + 12
 8 1   libstdc++.6.dylib                 0x38202410 std::string::operator=(char const*) + 8
 9 2   FishingJoy                        0x003423a0 FishNetCollideHandler::JSONLoaderDidLoad(char const*) + 1936
10 3   FishingJoy                        0x00342b90 non-virtual thunk to FishNetCollideHandler::JSONLoaderDidLoad(char const*) + 32
11 4   FishingJoy                        0x002fb3e0 -[JSONLoaderDelegateEx JSONLoaderDidLoad:withResult:] + 144
12 5   FishingJoy                        0x002fae3c -[JSONLoader requestFinished:] + 352
13 6   CoreFoundation                    0x380b4224 -[NSObject performSelector:withObject:] + 36
14 7   FishingJoy                        0x002d5614 -[ASIHTTPRequest reportFinished] + 164
15 8   CoreFoundation                    0x380b4224 -[NSObject performSelector:withObject:] + 36
16 9   Foundation                        0x3548e750 __NSThreadPerformPerform + 344
17 10  CoreFoundation                    0x38129afc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
18 11  CoreFoundation                    0x3812935e __CFRunLoopDoSources0 + 358
19 12  CoreFoundation                    0x3812806e __CFRunLoopRun + 646
20 13  CoreFoundation                    0x380ab4d6 CFRunLoopRunSpecific + 294
21 14  CoreFoundation                    0x380ab39e CFRunLoopRunInMode + 98
22 15  GraphicsServices                  0x37e82fc6 GSEventRunModal + 150
23 16  UIKit                             0x31c2b73c UIApplicationMain + 1084
24 17  FishingJoy                        0x0000389c main + 84
25 18  FishingJoy                        0x0000383c start + 32

轉載于:https://www.cnblogs.com/lynn87/archive/2012/11/13/2768233.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/377099.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/377099.shtml
英文地址,請注明出處:http://en.pswp.cn/news/377099.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

《dp補卡——多重背包》

多重背包簡介: 有N種物品和一個容量為V的背包。第i種物品最多有Mi件可用,每件耗費的空間為Ci,價值為Wi。求解將哪些物品裝入背包可使得這些物品耗費的空間總和不超過背包容量,且價值總和最大。 將Mi件攤開,就是一個01背…

kafka消息確認ack_什么是確認(ACK)? ACK代表什么?

kafka消息確認ackACK:致謝 (ACK: Acknowledgment) An acknowledgment (ACK) is a signal that is passed among the communicating processes, computers, or devices to indicate acknowledgment, or delivery of the message, as a component of a communications…

CocoaAsyncSocket 套接字

CocoaAsyncSocket 套接字 https://github.com/robbiehanson/CocoaAsyncSocket Asynchronous socket networking library for Mac and iOS 用于iOS以及Mac的異步套接字網絡庫。 TCP GCDAsyncSocket and AsyncSocket are TCP/IP socket networking libraries. Here are the key…

谷歌瀏覽器設置緩存方法

谷歌瀏覽器設置緩存方法: 1、在桌面Google Chrome快捷方式,目標:找到 C:\Users\Splendid\AppData\Local\…\Application\chrome.exe 在這后面加上-Disk-Cache-Dir”Z:\TEMP” 注意: -Disk前面有空格,”Z:\TEMP” 是文件存放在Z盤T…

《dp補卡——買賣股票問題》

目錄121. 買賣股票的最佳時機貪心dp思路滾動數組優化122. 買賣股票的最佳時機 II123. 買賣股票的最佳時機 III188. 買賣股票的最佳時機 IV309. 最佳買賣股票時機含冷凍期714. 買賣股票的最佳時機含手續費121. 買賣股票的最佳時機 貪心 取最左最小值,取最右最大值&…

oo0ooo0ooo0oo_OoO的完整形式是什么?

oo0ooo0ooo0ooOoO:外出 (OoO: Out of Office) OoO is an abbreviation of "Out of Office". OoO是“不在辦公室”的縮寫。 It is an expression, which is commonly used in the Gmail platform. It is written in the body or the subject of the email…

SP2010開發和VS2010專家食譜--第三章節--高級工作流(2)--為沙盒解決方案創建自定義活動...

盡管沙河解決方案功能有限,你仍然可以開發自定義活動,在SharePoint Designer中使用而不用改變web.config或添加.ACTION文件到根文件夾。 轉載于:https://www.cnblogs.com/crazygolf/p/3856795.html

sql where 1=1和 0=1 的作用

where 11; 這個條件始終為True,在不定數量查詢條件情況下,11可以很方便的規范語句。 一、不用where 11 在多條件查詢中的困擾 舉個例子,如果您做查詢頁面,并且,可查詢的選項有多個,同時,還讓用戶…

j@2ff4f00f_J4F的完整形式是什么?

j2ff4f00fJ4F:只是為了好玩 (J4F: Just For Fun) J4F is an abbreviation of "Just For Fun". J4F是“ Just For Fun”的縮寫 。 It is an expression, which is commonly used in messaging or chatting on social media networking sites like Faceboo…

《dp補卡——子序列問題》

目錄300. 最長遞增子序列674. 最長連續遞增序列718. 最長重復子數組1143. 最長公共子序列53. 最大子序和392. 判斷子序列115. 不同的子序列583. 兩個字符串的刪除操作72. 編輯距離647. 回文子串 (與 5.最長回文子串思路差不多)516. 最長回文子序列300. 最…

[LeetCode] Maximal Rectangle

Given a 2D binary matrix filled with 0s and 1s, find the largest rectangle containing all ones and return its area. 在做 Largest Rectangle in Histogram的時候有人說可以用在這題,看了一下還真是,以每行為x軸,每列往上累計的連續的…

什么是alpha測試_什么是ALPHA?

什么是alpha測試Α (ALPHA) Alpha is the first and foremost letter of the Greek alphabet. In the classification of Greek numerals or numbers, it constitutes a value of 1. Alpha是希臘字母的第一個也是最重要的字母 。 在希臘數字或希臘數字的分類中,它的…

《leetcode : 647. 回文子串 思考分析雙指針解法》

647. 回文子串 如何確定是回文串: 找中心然后往兩邊擴散,判斷是否對稱即可。 在遍歷中心點的時候,注意中心點可以是一個元素也可以是兩個元素。 class Solution { public:int cal_two_extend(const string& s,int i,int j,int n){int re…

天草初級班(3)

算術運算指令算術運算指令是反映CPU計算能力的一組指令,也是編程時經常使用的一組指令。它包括:加、減、乘、除及其相關的輔助指令。 該組指令的操作數可以是8位、16位和32位(80386)。當存儲單元是該類指令的操作數時,該操作數的尋址方式可以…

4.3.3版本之引擎bug

bug描述:   IOS設備上,當使用WWW www WWW.LoadFromCacheOrDownload(url, verNum); 下載資源時,第一次下載某個資源,www.assetBundle必定為空。 解決辦法:   引擎版本降到4.3.2或者升到4.3.4或更高。 這個bug絕對是…

sml完整形式_411的完整形式是什么?

sml完整形式411:信息 (411: Information) 411 is an abbreviation of “Information". 411是“信息”的縮寫 。 It is an expression, which is commonly used in messaging or chatting on social media networking sites like Facebook, Yahoo Messenger, a…

php 檢測用戶是否關閉瀏覽器

1、例子1 echo str_repeat(" ",3000);ignore_user_abort(true); mylog(online);while (true) {/** 1、程序正常結束 connection_status 0* 2、點擊瀏覽器“停止”按鈕 connection_status 1* 3、超時 connection_status 2*/echo "test<br>\n&qu…

explain用法

explain用法 EXPLAIN SELECT …… 變體&#xff1a; 1. EXPLAIN EXTENDED SELECT …… 將執行計劃“反編譯”成SELECT語句&#xff0c;運行SHOW WARNINGS 可得到被MySQL優化器優化后的查詢語句 2. EXPLAIN PARTITIONS SELECT …… 用于分區表的EXPLAIN 執行計劃包含的信息 id…

《位運算技巧以及Leetcode的一些位運算題目》

目錄技巧練習位運算[461. 漢明距離](https://leetcode-cn.com/problems/hamming-distance/)[190. 顛倒二進制位](https://leetcode-cn.com/problems/reverse-bits/)[136. 只出現一次的數字](https://leetcode-cn.com/problems/single-number/)[260. 只出現一次的數字 III](http…

linux讀取配置文件(C語言版)

一個通用的linux系統中C語言版讀取配置文件的函數。 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <errno.h>#define KEYVALLEN 100/* 刪除左邊的空格 */ char * l_trim(char * szOutput, con…