新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 關于arm處理器 內存編址模式 與 字節對齊方式

        關于arm處理器 內存編址模式 與 字節對齊方式

        作者: 時間:2016-11-09 來源:網絡 收藏
        在x86+Linux上寫的程序,在PC機上運行得很好。可是使用ARM的gcc進行交叉編譯,再送到DaVinci目標板上運行的時候,出現了Bus error。
        出現的位置如下(其中Debug的內容是我在程序中添加的調試信息):
        root@211.69.193.189:~# arm_v5t_le-gcc -g shit.c
        root@211.69.193.189:~# ./a.out
        Debug: malloc space for the actual data: temp_buf = 0x13118
        Debug: in my_recvn()
        Debug: nleft = 52
        Bus error
        打開調試器進行調試:
        root@211.69.193.189:~# gdb a.out
        GNU gdb 6.3 (MontaVista 6.3-20.0.22.0501131 2005-07-22)
        Copyright 2004 Free Software Foundation, Inc.
        GDB is free software, covered by the GNU General Public License, and you are
        welcome to change it and/or distribute copies of it under certain conditions.
        Type "show copying" to see the conditions.
        There is absolutely no warranty for GDB. Type "show warranty" for details.
        This GDB was configured as "armv5tl-montavista-linuxeabi"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

        (gdb) run // 運行程序
        Starting program: /home/zpf/a.out
        Debug: in get_program_info()
        Debug: in conn_server(char *err_buf_ptr)
        Debug: gonna create a socket
        Debug: gonna fill in the serv_addr structure
        Debug: gonna connect to a server
        Debug: gonna send LIN_RST
        Debug: in my_sendn()
        Debug: send 4 bytes to server: 
        Debug: gonna receive LIN_RSP
        Debug: in my_recvn()
        Debug: nleft = 3
        Debug: received first 3 bytes from server: 7
        Debug: gonna check if 3rd byte is the package type
        Debug: received package length = 55
        Debug: malloc space for the actual data: temp_buf = 0x13118
        Debug: in my_recvn()
        Debug: nleft = 52

        Program received signal SIGBUS, Bus error. // 在這里出現了錯誤
        0x09624 in alloc_prog_mem (detail_buf=0x13118 " 主站蜘蛛池模板: 高碑店市| 新丰县| 泸西县| 文登市| 连云港市| 玉门市| 温宿县| 新宾| 贺兰县| 山西省| 砀山县| 崇仁县| 法库县| 高邮市| 蕉岭县| 太康县| 庆元县| 定兴县| 沙雅县| 余干县| 河津市| 昆明市| 万安县| 彰化市| 遂川县| 南安市| 马尔康县| 定远县| 武宣县| 新河县| 来宾市| 石林| 杭锦旗| 昌邑市| 娄底市| 兴安县| 高州市| 荆州市| 汤阴县| 洪泽县| 新沂市|