顯示具有 ARM 標籤的文章。 顯示所有文章
顯示具有 ARM 標籤的文章。 顯示所有文章

2015年1月24日 星期六

my ide

 

Interface

image

Plugin & vimrc (configure)

set nocompatible              " be iMproved, required
filetype off                  " required
set guioptions-=m  "remove menu bar
set guioptions-=T  "remove toolbar
 
" set the runtime path to include Vundle and initialize
set rtp+=~/vimfiles/bundle/Vundle.vim/
let path='~/vimfiles/bundle'
call vundle#begin(path)
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
 
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'vim-scripts/L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
"for nerdtree
Plugin 'scrooloose/nerdtree'
"commenting
Plugin 'scrooloose/nerdcommenter'
"snipmate
Plugin 'msanders/snipmate.vim'
Plugin 'ervandew/supertab'
"Plugin 'vim-scripts/OmniCppComplete'
 
"file manager
Plugin 'wesleyche/SrcExpl'
Plugin 'vim-scripts/taglist.vim'
Plugin 'wesleyche/Trinity'
Plugin 'tomtom/tlib_vim'
Plugin 'tomtom/tselectbuffer_vim'
Plugin 'vim-scripts/a.vim'
Plugin 'vim-scripts/FuzzyFinder'
"project 
Plugin 'vim-scripts/DfrankUtil'
Plugin 'vim-scripts/project.tar.gz'
Plugin 'vim-scripts/indexer.tar.gz'
Plugin 'vim-scripts/vimprj'
Plugin 'tomtom/TortoiseSVN_vim'
"color sch
Plugin 'junegunn/seoul256.vim'
"marks
"Plugin 'kshenoy/vim-signature'
Plugin 'MattesGroeger/vim-bookmarks' 
"calender
Plugin 'mattn/calendar-vim'
"compiler
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-pathogen'
 
"status bar
Plugin 'bling/vim-airline'
"format
Plugin 'vim-scripts/Align'
Plugin 'Chiel92/vim-autoformat'
Plugin 'mrtazz/DoxygenToolkit.vim'
"fun
Plugin 'mattn/flappyvird-vim'
Plugin 'vim-scripts/TeTrIs.vim'
Plugin 'vim-scripts/sokoban.vim'
 
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
let g:seoul256_background = 246
"colo seoul256-light
colo seoul256
" 檔案編碼
"set encoding=utf-8
"set fileencodings=utf-8,cp950
 
" 編輯喜好設定                                                                                                                                                                                                     
syntax on        " 語法上色顯示
set nocompatible " VIM 不使用和 VI 相容的模式
" set ai           " 自動縮排
set shiftwidth=4 " 設定縮排寬度 = 4 
set tabstop=4    " tab 的字元數
set softtabstop=4
set expandtab   " 用 space 代替 tab
 
set ruler        " 顯示右下角設定值
set backspace=2  " 在 insert 也可用 backspace
set ic           " 設定搜尋忽略大小寫
set ru           " 第幾行第幾個字
set hlsearch     " 設定高亮度顯示搜尋結果
set incsearch    " 在關鍵字還沒完全輸入完畢前就顯示結果
set smartindent  " 設定 smartindent
set confirm      " 操作過程有衝突時,以明確的文字來詢問
set history=100  " 保留 100 個使用過的指令
set cursorline   " 顯示目前的游標位置
 
set laststatus=2
set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
"key mapping
imap jj <;Esc>
noremap ,bb :TSelectBuffer<;cr>
" Open and close all the three plugins on the same time 
nmap <F7>  :TrinityToggleAll<CR> 
" Open and close the Source Explorer separately 
nmap <;F9>  :TrinityToggleSourceExplorer<CR> 
" Open and close the Taglist separately 
nmap <F10> :TrinityToggleTagList<CR> 
" Open and close the NERD Tree separately 
nmap <;F11> :TrinityToggleNERDTree<CR> 
imap    <;F2>    <C-R>=strftime("%c")<CR>
nmap    ,te :tabedit<;SPACE>
nmap    ,tx    :tabedit .<;CR>
nmap    ,th    :tab help<;CR>
nmap    ,tn    :tabnew<;CR>
 
map <;F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
exec "make -f ble_app_template.Makefile"
endfunc
 
map <;F6> :call RunGcc()<CR>
func! RunGcc()
exec "w"
exec "! %<"
endfunc
 
set nocp
 " Enable check c
"let g:syntastic_check_on_open = 1
"let g:syntastic_c_checkers = ['gcc', 'make'] 
"let g:syntastic_c_errorformat = '%f:%l:%c: %trror: %m'
"let g:syntastic_always_populate_loc_list = 1
"execute pathogen#infect()
 "airline
"let g:airline#extensions#tabline#enabled = 1
"format
let g:formatprg_c = "astyle"
let g:formatprg_args_c = "--style=allman --pad-oper --min-conditional-indent=0 --max-code-length=120 --add-brackets --break-blocks --delete-empty-lines --indent=spaces=4"
map ,fc :Autoformat<CR><CR> 
"bookmark
let g:bookmark_sign = '>;>'
let g:bookmark_annotation_sign = '##'
let g:bookmark_save_per_working_dir = 1
let g:bookmark_auto_save = 0
let g:bookmark_auto_save_file = '/bookmarks'
let g:bookmark_auto_close = 1
let g:bookmark_highlight_lines = 1
let g:bookmark_show_warning = 0
let g:bookmark_center = 1
 
"DoxygenToolkit
let g:DoxygenToolkit_briefTag_pre="@detail  "
let g:DoxygenToolkit_paramTag_pre="@param[] "
let g:DoxygenToolkit_returnTag="@returns    "
let g:DoxygenToolkit_blockHeader="@brief    function for"
let g:DoxygenToolkit_blockFooter="----------------------------------------------------------------------------"
let g:DoxygenToolkit_authorName="Copyright(C) MediaWave.,Ltd                                                     steven lin,All Right Reserved"
"indexer.tar.gz
"change the tags dir at ram disk
let g:indexer_tagsDirname ="F:\indexer"
map <F3>  :Dox <CR>
"change leader mapping
let mapleader=","
let g:SokobanLevelDirectory="C:\\Users\\steven\\vimfiles\\bundle\\\sokoban.vim\\"
"the tortoise svn
map <F8> :call CommitSVNAll()<CR>
func! CommitSVNAll()
    let buflist = []
    for b in range(1, bufnr('$'))
        if buflisted(b) && filereadable(bufname(b))
            call add(buflist, fnamemodify(bufname(b), ':p'))
        endif
    endfor
    let files = join(buflist, '*')
    if files != ''
        silent exec '!start "C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:commit /path:"'.files.'" /closeonend:4'
    else
        call confirm('No files loaded')
    endif
endfunc
map ff <;esc>:FufFile<cr>
map fcd <;esc>:FufDir<cr>
map fbw <;esc>:FufBufferTagAllWithCursorWord<cr>
map fbb <;esc>:FufBuffer<cr>
 


make operator


A.make


image


:copen


image


download:


…………………


ref:


vim make:


https://www.cs.oberlin.edu/~kuperman/help/vim/makefiles.html

2014年12月14日 星期日

enum container always int

 

keyword:

compiler options,gcc,static lib and linker

在使用外部協力商所給的lib(static lib)出現了..

Cannot link object as its attributes are incompatible with the image attributes

原本,以為是那邊給錯了..所以試著去查了一下它的內容.用gnu Binutils(ar,nm)

看看是那邊有問題,依著Linker Error 可能原因有

a.alignment

b.endian

c.different --fpu

但,看起來這幾項都不應該出現.

除了去信要求協力商再次檢查其lib 外.

而其中,原本是懷疑是c ,即它可能用到float point運算.

A.

但,我還是得先以gcc Binutils(ar and nm)去看一下是不是它原本就有問題.像是給錯或檔案毀壞. 其結果如下.

image

fig . readelf . to check the ABI versiion and endian

image

fig. ar . static lib to check the conatin .

image

fig . nm ; to show the symbol

由上可得出,能排及b (endian)及obj file 毀壞.

而我還是不能得到它的原因.因此

請其它同事以不同的案子去試著linker. 卻是正常的

所以看了一下它的環境,才得出這個答案.enum container always int

B.

在disable 原本在compiler對於enum container always int 設定後.

C陷阱篇之enum默认长度 以這篇所敘述的內容.

"enum是一种数据类型,使用时会检查类型匹配".因此

    enum长度不确定会带来可移植性问题,如果第三方库API接口使用enum类型,编译和调用库时一旦有关enum长度的编译器设置不一致,API接口层对数值的解析就不匹配。比如上层应用编译时没有用-fshort-enums,默认用4字节空间来存储使用enum变量,而编译库时设置了fshort-enums,则库内部此enum size可能为1。当把enum变量地址传进API时,内部只修改变量最低字节,高3字节值无变化(内容随机),API返回时,上层使用的4字节enum变量值就可能随机。(潜规则篇之API接口)

"因此内部代码使用enum类型优于define,但对外API接口尽量避免用enum型。"

C.

那麻,這個問題要如何由gcc Binutils 去檢查?

它是由對外的API 所宣告的enum所造成的,因此首先就是對所有對於的API (nm 中的T)

但我自己建立lib後,卻不論是否有enable enum container always int 其程式也是可以動作??而且以objdump 也沒看到它有去檢查??

D.

最後,在未來建立自己的Lib及使用它人的Lib這些都需要特別注意

C潜规则篇之API接口

http://blog.csdn.net/ipmux/article/details/17309277

ref:

Linker Error: L6242E: Cannot link object <objname> as its attributes are incompatible with the image attributes.

http://infocenter.arm.com/help/topic/com.arm.doc.faqs/ka4223.html

gnu gcc basic

https://docs.google.com/document/d/1rKNprDiocE094tU3xq_waHIN-tHpY_Tuum84pSoTEZE/edit?usp=sharing

http://infocenter.arm.com/help/topic/com.arm.doc.dui0491f/Babjddhe.html

https://answers.launchpad.net/gcc-arm-embedded/+question/224724

http://infocenter.arm.com/help/topic/com.arm.doc.dui0348c/CHDIBFAB.html

http://blog.csdn.net/ipmux/article/details/17334099