在Linux上使用什么工具来开发C ++应用程序? [英] What tools do you use to develop C++ applications on Linux?

查看:219
本文介绍了在Linux上使用什么工具来开发C ++应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux环境中开发C ++应用程序。我每天使用的工具包括Eclipse与CDT插件,gdb和valgrind。

其他人使用什么工具?有没有什么东西在Linux上与微软Visual Studio的光滑性相媲美?

I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind.
What tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio?

推荐答案

我使用一堆终端窗口。我有vim运行在有趣的源文件,make和g ++输出另一个为编译器错误或gdb会话运行时错误。如果我需要帮助找到定义,我运行cscope并使用vim的cscope支持来跳转。

I use a bunch of terminal windows. I have vim running on interesting source files, make and g++ output on another for compiler errors or a gdb session for runtime errors. If I need help finding definitions I run cscope and use vim's cscope support to jump around.

Eclipse CDT是我的第二选择。与vim相比,它很好,但是很庞大,不显眼和缓慢。

Eclipse CDT is my second choice. It's nice but huge, ungainly and slow compared to vim.

使用终端窗口和vim是非常灵活的,因为我不需要携带400 MB的Java可以使用任何地方的SSH会话。

Using terminal windows and vim is very flexible because I do not need to carry 400 MB of Java around with me I can use SSH sessions from anywhere.

我需要找到内存问题时使用valgrind。

I use valgrind when I need to find a memory issue.

使用 strace 来查看我的软件在系统调用级别上执行的操作。这让我清理真的愚蠢的代码,连续调用 time(0)四次或调用 poll()或非阻塞 read()或者在套接字上调用 read()字节。 ( super 效率低下和懒惰!)

I use strace to watch what my software is doing on a system call level. This lets me clean up really stupid code that calls time(0) four times in a row or makes too many calls to poll() or non-blocking read() or things like calling read() on a socket to read 1 byte at a time. (That is super inefficient and lazy!)

我使用 objdump -d 检查机器代码,特别是对性能敏感的内部循环。这是我如何找到像字符串数组索引操作符的缓慢与使用迭代器。

I use objdump -d to inspect the machine code, especially for performance sensitive inner loops. That is how I find things like the slowness of the array index operator on strings compared to using iterators.

我使用oprofile尝试找到优化的代码中的热点,我发现它通常工作比gprof好一点,它可以做的事情,如寻找数据和指令缓存未命中。这可以告诉你在哪里使用GCC的 __ builtin_prefetch 删除一些有用的预取提示。我试图用它来找到热误预测的分支,但不能让我为我工作。

I use oprofile to try to find hot spots in optimized code, I find that it often works a little better than gprof, and it can do things like look for data and instruction cache misses. That can show you where to drop some helpful prefetch hints using GCC's __builtin_prefetch. I tried to use it to find hot mis-predicted branches as well, but couldn't get that to work for me.

更新:我发现perf工程方法比oprofile好。至少在Linux上。学习使用perf,并像我一样爱它。

Update: I've found that perf works way better than oprofile. At least on Linux. Learn to use perf and love it as I do.

这篇关于在Linux上使用什么工具来开发C ++应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆