OSX Macvim + vim-lldb configuration and usage experience

Source: Internet
Author: User

The default compiler in Mac is clang/clang++

That's why debugger chose Lldb.

Want to use with Macvim together, so found the vim-lldb this plugin, quite powerful

?

This plugin supports Vundle, so it's easier to install.

But I found in the installation process vim hints Python Fatal error,

I finally found out that I used brew to install a third-party python,

So there are two python in the system: Native Python and third-party python, causing the error

The solution is to uninstall or unlink, with a brew-mounted python

Brew Uninstall Python

Or

Brew Unlink Python

Note that this may cause problems with your other programs that are compiled by third parties, so be cautious.

The worst case scenario is to compile the python again with the system's own ... 233333

?

How to use:

1. In terminal, the CPP file is compiled with debug mode, and the A.out file is generated by default

clang++-G test.cpp

2. Open the Test.cpp file with Vim/macvim and specify the target executable file

Vim Test.cpp

In Vim, enter

: Ltarget a.out

It will then mediate a bunch of windows, including locals, breakpoints and so on.

3. In Vim, enter

: Lstart

Start debugging, this time, because you do not set a breakpoint, so the program ran out

4. In vim, where you need to set a breakpoint, enter

: Lbreakpoint

You can set a breakpoint at the cursor position.

5. Re-execute: The Lstart command can be stopped at the breakpoint.

?

The shortcut keys I defined in the. vimrc file are as follows

" vim-lldb Settings
let g:lldb_map_Lstart = “<F5>"
let g:lldb_map_Lcontinue = “<F6>"
let g:lldb_map_Lbreakpoint = “<F9>"
let g:lldb_map_Lnext = “<F10>"
let g:lldb_map_Lstep = “F11"

?

Other commands to see the help in vim: he lldb

?

?

?

OSX Macvim + vim-lldb configuration and usage experience

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.