debug c c++ programs more comfortably @ 2014.12.14 trace code meetup

16
Debug C/C++ Programs more Comfortably StarNight @ 2014.12.14 Trace Code Meetup

Upload: chien-hung-pan

Post on 12-Jul-2015

884 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

Debug C/C++ Programs more Comfortably

StarNight @ 2014.12.14 Trace Code Meetup

Page 2: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

Who am I?

潘建宏 / Jian-Hong Pan (StarNight)About Me : http://about.me/StarNight

出沒在~

GitHub : starnightPTT : zack2004plurk : StarNightFacebook : Jian-Hong Pan

目前繼續在種花店當個打雜園丁 ~

Page 3: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

如果今天期望在這場聽到GDB的使用方法,那我可能

讓你失望了!!!I'll make you disappoint,

if you want to learn how to use GDB!!!

Page 4: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

I’ll introduce the toolswhich make debug more efficient.

我要說的是,使用友善的工具讓debug更有效率

Page 5: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

I love terminal.I program with VIM & GDB.I want to debug in terminal.

Page 6: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

If there is a tool to use GNU Debugger with presented

codes at the same time, that will be useful when

debugging.

Page 7: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

Just like this ...

Codes

GNU Debugger

Terminal

Page 8: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

● https://github.com/larrupingpig/vimgdb-for-vim7.4

● It is a VIM patch that implements gdb support in the vim editor.

● You need to rebuild VIM with this patch, if you want to install it.

vimGdb

Page 9: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

clewn

● http://clewn.sourceforge.net/● It implements gdb support in the vim editor.● It is a program controlling vim through the

netBeans socket interface.● Clewn can only be used with “gvim”, not vim.● Clewn, as a standalone process, needs its

own terminal.

Page 10: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

pyclewn

● http://pyclewn.sourceforge.net/● pyclewn allows using vim as a front end to a

debugger.● It is like clewn, but is implemented with

python. → cross platform● pyclewn has more gdb features than clewn.

Page 11: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

Comparison of clewn, vimGdb and pyclewn

http://pyclewn.sourceforge.net/

Page 12: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

However, I want the tool works in terminal without

graphic support. → no gvimBesides, it is complicated to

install vimGdb.

Page 13: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

● http://www.vim.org/scripts/script.php?script_id=4582

● GDB command line interface and terminal emulator in (G)Vim.

● https://www.youtube.com/watch?v=ZcSjaYSoqnc

● It needs GDB 7.0+ and full python 2.7 support.

● It is a “VIM plugin”.

Conque GDB

Page 14: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

Considering embedded system development, debugging with cross compile tool-chain is

needed.That will be a problem to Conque GDB.

Page 15: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

● https://cgdb.github.io/● cgdb is a lightweight curses (terminal-based)

interface to the GNU Debugger (GDB).● It provides a split screen view that displays

the source code as it executes.● http://tech.mozilla.com.tw/posts/3826/cgdb-

%E6%9B%B4%E5%A5%BD%E7%94%A8%E7%9A%84-gdb

● It is awesome!!!

cgdb

Page 16: Debug c c++ programs  more comfortably @ 2014.12.14 Trace Code Meetup

Thank you ~