由买买提看人间百态

topics

全部话题 - 话题: gdb
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
f****4
发帖数: 1359
1
既然扯到宏,就再说两句。
我讨厌宏就是因为每次看到宏,都得给它脑补(在大脑里给它补全)。我觉得这个在阅
读习惯上是非常反人性的。。。。我知道现在的一些ide能够自动补全,但是还是习惯
了用vim。vim下面有啥好的宏展开插件?
还有就是gdb的时候,就是非优化,带编译信息,要是宏里面出错,也就是定位在调用
宏的地方。gdb能支持更准确的地位不?
a****o
发帖数: 686
2
来自主题: JobHunting版 - experienced c++ developer, banking
please apply, my Chinese fellows.
need experienced C++ developers.
Stable Buyside company based in NY Manhattan. You job is to improve and
maintain a large scale C++ software/library.
need to know C++, STL, gdb, perl, working knowledge of Linux/unix.
basic algorithm, datastructure.
basic finance concept, mostly fixed income products, such like Bond/swap/,
how to compute duration, yield, key rate duration, etc. simple stuff.
basic applied math, simple classic probability, linear regression,
optim... 阅读全帖
n******r
发帖数: 869
3
来自主题: JobHunting版 - 程序员技术练级攻略
贡献好文:
http://coolshell.cn/articles/4990.html
月光博客6月12日发表了《写给新手程序员的一封信》,翻译自《An open letter to
those who want to start programming》,我的朋友(他在本站的id是Mailper)告诉
我,他希望在酷壳上看到一篇更具操作性的文章。因为他也是喜欢编程和技术的家伙,
于是,我让他把他的一些学习Python和Web编程的一些点滴总结一下。于是他给我发来
了一些他的心得和经历,我在把他的心得做了不多的增改,并根据我的经历增加了“进
阶”一节。这是一篇由新手和我这个老家伙根据我们的经历完成的文章。
我的这个朋友把这篇文章取名叫Build Your Programming Technical Skills,我实在
不知道用中文怎么翻译,但我在写的过程中,我觉得这很像一个打网游做任务升级的一
个过程,所以取名叫“技术练级攻略”,题目有点大,呵呵,这个标题纯粹是为了好玩
。这里仅仅是在分享Mailper和我个人的学习经历。(注:省去了我作为一个初学者曾
经学习过的一些技术(今天明显... 阅读全帖
w********s
发帖数: 1570
4
他会告诉你prod里的东西不能随便kill,log是第一个能看的。
如果你能kill,何不gdb attach上?
他的含义是prod里没有gdb
y****r
发帖数: 3036
5
☆─────────────────────────────────────☆
wennuan (锐锐) 于 (Sat Jul 20 23:50:23 2013, 美东) 提到:
晚上老公出去踢球了,我跟儿子去Framingham那边看家具,因为下午儿子睡了一大觉又吃
了些零食,天气又热,我们都不饿,所以看完家具都快9点了,心想就在附近吃点东西吧,
儿子说不想吃川菜, 想起来张豪就在附近, 几年没去过了,就去换换口味吧.
去到的时候已经快9点了,人不多,有三四桌正在吃,全是老外, 我们坐下等了一会,没有
人来,后来老板娘过来说,你要自己写菜,然后给我一张白纸, 当时并不忙,服务员和老板
娘在一堆前台聊天. 好吧,我就自己写了单子,点了酱鸭,生煎包,菜肉混沌,鲜肉月饼和
锅贴, 因为儿子喜欢吃面食. 写完招呼服务员,老板娘拉着长脸带搭不理的说, 搁那里
吧,我一会儿拿. 过了一阵拿走了,自始至终没有看我一眼,没有招呼,比当年大学里的大
师傅还横.
算了,等着上菜呗.
菜的质量实在没法恭维. 酱鸭不进味,肉也太紧,不够烂.混沌没什么味道,无论锅贴还是
包子,按照儿子的话说,怎么都... 阅读全帖
y****r
发帖数: 3036
6
☆─────────────────────────────────────☆
dragonren (龙人) 于 (Sun Jul 21 13:14:37 2013, 美东) 提到:
今天这个来黑张豪的,跟上次黑雅苑的同出一辙:一次吃得不快就据给小费,然后来这
里大发牢骚,甚至号召抵制,最可悲的是回帖里竟然还真有要跟着抵制的。
这个无疑曝显了中国人的劣根性之一,盲目地瞎起哄,自己没有任何经验跟理解的情况
先,根据别人一面之词就妄下定论,哎,用我以前语文老师的两次字说就是:可悲!
你如果是坚信wennuan的帖子,觉得张豪就是一垃圾馆子的话,那就请就此打住吧,无
需再读,因为我是挺张豪的,会说一些自己吃张豪多年的感受
首先,张豪老板娘:
她的态度前几年是非常之好的,确切的说比我吃过波士顿绝大馆子的态度要好,通过聊
天得知她家在那里已经开了二十多年了,平时自己小孩也会帮忙,不过我承认最近一两
年好像态度有所变冷,我可以想到两个原因:1)遇到wennuan那种无良顾客太多,心理
阴影了,2)到更年期了,内分泌作怪
虽然说没有以前chatty,但是我们去服务都是没有问题的,我平时去N... 阅读全帖
d**********o
发帖数: 1321
7
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3 & hw3b与导师邮件
** from: (me~~) <(me~~)@gmail.com>
to: cs445代课老师
date: Sun, Nov 3, 2013 at 12:23 AM
subject: Hw3 problems __ 20131103001216
mailed-by: gmail.com
Hi Dr. cs445代课老师,
I have made some progress with my homework 3, but they are still very
limited and right now, I am blocked 2 problems.
1. How do I set scopes for function parameter declaration list? For example,
int main (int x, char y){ } when x or y has been declared global before
this fu... 阅读全帖
d**********o
发帖数: 1321
8
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
雕刻时光(2)
这门课五次作业,到第三次作业写完,当初那完全不知道什么pre-traverse、post-
traverse的遍历,这时我也就拥有了power,对遍历有了完全的掌控力,对这编译的理
解消化就已经上了一个新台阶。第四次作业还有几个小的地方自己独立想不通;到第五
次作业,画架构一一写出c- compiler如何进main function,如何从main function
return statement出来,各function call的 frame pointer、return pointer是如何
与主架联接起来的一一这一步很艰难,总是在某个没想清楚的环节掉链子,生成的代码
运行不动了;等到把这个框架架起来后,剩下的部分因为饱受第三次作业的摧残、锻炼
,已经变得很是轻松写意了!
其实第一学期cs121代课老师已经在一次lab帮我们讲过了GDB debugging,上学期
Connect4 game、decision tree的时候稍微用了一下,但远没有到很熟悉、得心应手的
程度。第三次作业时代课老师还试着教我用这样一个工具;到这最后一次作业,因为一
句话的逻辑不清,就... 阅读全帖
d**********o
发帖数: 1321
9
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
hw3 & hw3b与导师邮件
** from: (me~~) <(me~~)@gmail.com>
to: cs445代课老师 <[email protected]
/* */>
date: Sun, Nov 3, 2013 at 12:23 AM
subject: Hw3 problems __ 20131103001216
mailed-by: gmail.com
Hi Dr. cs445代课老师,
I have made some progress with my homework 3, but they are still very
limited and right now, I am blocked 2 problems.
1. How do I set scopes for function parameter declaration list? For example,
int main (int x, char y){ } when x or y has been declared global before
th... 阅读全帖
d**********o
发帖数: 1321
10
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
雕刻时光(2)
这门课五次作业,到第三次作业写完,当初那完全不知道什么pre-traverse、post-
traverse的遍历,这时我也就拥有了power,对遍历有了完全的掌控力,对这编译的理
解消化就已经上了一个新台阶。第四次作业还有几个小的地方自己独立想不通;到第五
次作业,画架构一一写出c- compiler如何进main function,如何从main function
return statement出来,各function call的 frame pointer、return pointer是如何
与主架联接起来的一一这一步很艰难,总是在某个没想清楚的环节掉链子,生成的代码
运行不动了;等到把这个框架架起来后,剩下的部分因为饱受第三次作业的摧残、锻炼
,已经变得很是轻松写意了!
其实第一学期cs121代课老师已经在一次lab帮我们讲过了GDB debugging,上学期
Connect4 game、decision tree的时候稍微用了一下,但远没有到很熟悉、得心应手的
程度。第三次作业时代课老师还试着教我用这样一个工具;到这最后一次作业,因为一
句话的逻辑不清,就... 阅读全帖
d****p
发帖数: 685
11
来自主题: Apple版 - Xcode 4都收费了
eclipse能做gdb的前台吗?没怎么用过。
目前Xcode在非obj-c开发的一个突出用途是做gdb的gui frontend.
l*******r
发帖数: 623
12
来自主题: Apple版 - 正式加入Apple 阵营
觉得gdb和xcode的整合很不错,有个gdb的console真是好啊
S**I
发帖数: 15689
13
看来你在程序调试上只能说是入门;设置断点、检查变量值之类是调试工具的基本功能
,*nix上的调试工具(譬如GDB)怎么会没有?Xcode也有这类功能。另外,应用程序调
试可以用printf,内核调试是不能用这个的。
VS的长处是界面很友好,简单易学,容易上手,而且对C++ STL调试的支持很好。GDB一
直到7.x才支持对C++ STL的内部变量检查,而且还得结合python用pretty printer实现
,比VS麻烦多了。
不过Windows上最强大的调试工具不是VS,而是WinDbg;VS强大的地方是作为一个集成
开发环境基本上是无敌的,但2010以前的VS在程序调试能力方面和WinDbg相比就是渣;
一直到2012才勉强能和WinDbg匹敌。不过WinDbg的学习曲线过于陡峭,非初学者能轻易
掌握。
d****i
发帖数: 4809
14
来自主题: Java版 - Eclipse 做得很好
Eclipse有CDT,可以作为Linux下不用vi, emacs, gdb的一种GUI alternative,实际上
习惯了在Unix下编程的人还是习惯用vi, make, gdb这些东西。
r***u
发帖数: 241
15
来自主题: Linux版 - firefox开始崩溃了。。。
可以用gdb attach到进程,崩溃时就会停在gdb里面,然后看看call stack
什么distro?gentoo最新的glibc有问题
e***e
发帖数: 168
16
1. find out before which lines you want to discard. For example, you want to
discard from beginning until line 100.
2. Go to the beginning of the file by pressing Alt + <
3. Hold ctrl, then enter number 100.
4. Still hold ctrl, press k. The last step will delete from beginning to
line 100.
k****f
发帖数: 3794
17
Error:
Text is read-only

to
E*V
发帖数: 17544
18
来自主题: Linux版 - 对了,关于debugger
1,gdb了
2. gdbtui (你们可以试试,呵呵)
3. ddd, 没有highlight syntax
4. gvd, gnu visual debugger ,有高亮,syntax,这个推荐
if you can not find it , search gnat
5. emacs + gdb
6. vim + gdb
a9
发帖数: 21638
19
int i, j, n, ch, isnull;
int needQuote;
char *escarg = va_arg(ap, char *);
isnull = escarg == 0;
if (isnull)
escarg = (xtype == etSQLESCAPE2 ? "NULL" : "(NULL)");
for (i = n = 0; (ch = escarg[i]) != 0; i++)
{
if (ch == '\'' || (xtype == etSQLESCAPE3 && ch == '\\'))
n++;
}
编译没问题,但运行的时候for (i = n = 0; (ch = escarg[i]) != 0; i++)报
Segmentation fault.
gdb:
Program terminated with signal 11, Segmentation fault.
#0 vxprintf (arg=0x40b77be0, fmt=0x4024ac72 "q'", ap=,
... 阅读全帖
a9
发帖数: 21638
20
其实我不会用gdb,只是在gdb上看到了上面的错误,不知道下一步该咋办了,呵呵。
p*****w
发帖数: 429
21
简单问题,如何修改各种mapping
而且不能side by side阿,把gdb放右边?

而且不能side by side阿,把gdb放右边?
w*s
发帖数: 7227
22
【 以下文字转载自 Programming 讨论区 】
发信人: wds (净洗前尘,从头再来), 信区: Programming
标 题: segmentation fault as soon as entering 1 function in the arm processor board
发信站: BBS 未名空间站 (Sat Dec 15 22:20:01 2012, 美东)
Hi everyone,
i'm lost on this one, can someone give me some hints ?
1. downloaded latest stunnel package from web
2. build in the host linux and runs fine
3. build for arm target (am using the same settings from before,
my task is to upgrade to latest stunnel)
4. builds ok, when run in arm board, seg fau... 阅读全帖
w*s
发帖数: 7227
23
来自主题: Linux版 - arm 太难开发了
native gdb never worked in our ARM,
set up gdb/gdbserver,
can step into app.
But when step into functions from shared library, segmentation fault.
You have to use a trick to step into *.so files.
painful ...
w*s
发帖数: 7227
24
来自主题: Linux版 - a dummy OS question (转载)
【 以下文字转载自 Programming 讨论区 】
发信人: wds (中原一点红:心开运就通,运通福就来), 信区: Programming
标 题: Re: a dummy OS question
发信站: BBS 未名空间站 (Sat Apr 19 10:27:23 2014, 美东)
各位大牛,容我尽力描述一下,请大家畅所欲言,非常感谢。
linux system, two rs485 ports, ~50 devices attached on these 2 ports.
~100 processes in the system from linux itself. 4 core arm.
in many sense it's like a linux desktop with our app running.
could get very busy, e.g. like the moment you open office in linux.
1. original design was like this, also tested well enough,
... 阅读全帖
a***e
发帖数: 1140
25
来自主题: Programming版 - core dump 后的尸体能debug吗?
在LINUX下。用g++编译后的C++代码(编译码包含-g参数),运行测试文件后出错,core
dump,生成core.12345尸体。
我能对这尸体进行gdb debug吗?
我不想直接用 gdb exec_file。 原因是我代码里有随机数发生器,我用随机数来控制
branch。 如果再执行一遍控制次序就不一样了。
c****e
发帖数: 1453
26
来自主题: Programming版 - 编程语言选择问题
那么多讨论debugging的帖子都没有提到windbg的.难道大家在windows上debug都是VS?
windows和gdb相比较的是windbg,超级强大. VS完全是另外一个路子的, 虽然code base
开始是一样的. 当然manage code debugger那一套还是VS方便. windbg超多extension,
一点不比gdb弱. tracing还有基于trace的checker windows也有很多方案, 不比
valgrind差, 不光是memory leak, registry, file, concurrency都可以check.
b***y
发帖数: 2799
27
☆─────────────────────────────────────☆
oOOo (\_/o!o\_/) 于 (Wed Sep 7 01:50:59 2005) 提到:
they are the same

1;"?
☆─────────────────────────────────────☆
cdr (可读可写) 于 (Wed Sep 7 02:18:37 2005) 提到:
1;"?
The second one has a symbal "A" in the symbal table.
☆─────────────────────────────────────☆
thrust (Thrust Jaeina) 于 (Wed Sep 7 13:16:53 2005) 提到:
const char* and char const* are the same. (if you use gdb, gdb always use the
later form.)
#define A 1 and const int A=1 are NOT the
z****e
发帖数: 2024
28
来自主题: Programming版 - emacs多窗口的一个问题。
C+x 2把现有的显示代码的窗口分了
然后 M+x: gdb, 上面的窗口变成gdb了。
然后 M+x:compile, 怎么下面的窗口变成显示编译结果的窗口了?
如何选择把哪一个窗口设为永远显示代码的,而另一个灵活可变?
目前觉得一旦执行 M+x,就比较乱,不知道那个窗口会变化,然后还要用C+x左右箭头
给找回来。
早谢了。
d****p
发帖数: 685
29
if you can launch gdb, then you can find where the crash occurred and
disassemble the instruction to see whether it is a write or read.
for example, if the segmentation fault happens at 0x0000000000400538,
use disas 0x0000000000400538 to check the instruction.
Program received signal SIGSEGV, Segmentation fault.
0x0000000000400538 in main ()
(gdb) disas 0x0000000000400538
Dump of assembler code for function main:
0x0000000000400528 : push %rbp
0x0000000000400529 : mov
g****y
发帖数: 436
30
来自主题: Programming版 - help on pthreads.....
gdb output:
Program received signal SIGSEGV, Segmentation fault.
pthread_join (threadid=0, thread_return=0x7fffffffe040) at pthread_join.c:46
46 pthread_join.c: No such file or directory.
in pthread_join.c
(gdb) bt
#0 pthread_join (threadid=0, thread_return=0x7fffffffe040)
at pthread_join.c:46
#1 0x0000000000410fab in joinThread (th=0) at threading.h:18
#2 0x0000000000413270 in ranger (argc=32767, argv=0x7ffff584b910)
at ranger.c:432
#3 0x000000000040a9e7 in main (argc=12, arg
y*******g
发帖数: 6599
31
来自主题: Programming版 - CodeBlocks cannot display vector in Watches
没用过codeblocks
不过gdb对stl的支持就是不好吧,,
http://sourceware.org/gdb/wiki/STLSupport
p*****w
发帖数: 429
32
来自主题: Programming版 - Re: 有pyclewn大牛吗?教教怎么用?
【 以下文字转载自 Linux 讨论区 】
发信人: prognew (prog new), 信区: Linux
标 题: Re: 有pyclewn大牛吗?教教怎么用?
发信站: BBS 未名空间站 (Fri Nov 4 23:33:24 2011, 美东)
简单问题,如何修改各种mapping
而且不能side by side阿,把gdb放右边?
而且不能side by side阿,把gdb放右边?
b******n
发帖数: 592
33
来自主题: Programming版 - Re: 有pyclewn大牛吗?教教怎么用?
-w LOCATION, --window=LOCATION
open the debugger console window at LOCATION
which may be one of (top, bottom, left,
right), the default is top
help pyclewn
或者网站上都可以看到。最近朋友介绍了一个sublime text,我装了一个。调试
程序很麻烦,所以大家尽量做到不用调试,test比较重要
我的感觉用gdb还是直接用好,换了ide我还不如何设置条件断点, gdb有个
text mode可以显示原文件,你可以试试。。
你最好把你所有改动恢副到未改动前,然后就用let设置以后:Pyclewn
:CFile 你应该可以看到效果。。
如果还不行,我也帮不了你。。。
对了,我是在Linux下,没有在Mac试过
t****t
发帖数: 6806
34
来自主题: Programming版 - 震惊:java 的矩阵操作比 c++ 快?
gdb 现在支持python的script, 可以把container之类的元素显示得很清楚
理论上每个.so可以带一套script, gdb可以按类型自动选择. 比如说vector, 你本来只
是显示首尾指针, 现在就可以自动显示每个元素, 长的还可以截断.
fedora自动装好的, 别的dist不清楚
j*****I
发帖数: 2626
35
用gdb跟了一下,
(gdb) info locals
c1 = 0x7fff96489d80 "ABC"
c2 = 0x4005ff "ABC"
fun1()返回的str确实是stack的地址。如果在func1里面加个printf("%d",str);什么的
,好像这个stack里面的string就hold住了,main打印出来的就不是乱码了。

stack.
be
w*s
发帖数: 7227
36
Hi everyone,
i'm lost on this one, can someone give me some hints ?
1. downloaded latest stunnel package from web
2. build in the host linux and runs fine
3. build for arm target (am using the same settings from before,
my task is to upgrade to latest stunnel)
4. builds ok, when run in arm board, seg fault.
5. from gdb core,
[New LWP 867]
Cannot access memory at address 0x70797263
(gdb) bt
#0 parse_commandline (name=0xbefdce29 "/opt/ultra/config/stunnel.conf",
parameter=0xbefdce48 "-version") at... 阅读全帖
d**********x
发帖数: 4083
37
来自主题: Programming版 - 看来你们是真心没做过web啊
....
我的意思是说,seg fault这种特别类型的bug,几乎不需要你单步去看逻辑,只要把
gdb跑上,重现就行了
或者gdb失灵的时候把valgrind跑上,重现就行了
memory bug其实没有那么难调。
d**********x
发帖数: 4083
38
来自主题: Programming版 - 求教linux下debug的问题
1. 打断点怎么会打不进去。。。你肯定是弄错了
2. 打log的方式适合调试和UI有关的bug,一般的bug还是断点比较好
3. 如果单步了半天没有头绪,不妨跳出来用脑子分析下问题,想想debug策略
4. 十几个函数真不算多
5. gdb可以存profile的,你google一下,省得每次开gdb还要把断点重新打一遍。

if
..
d*******r
发帖数: 3299
39
来自主题: Programming版 - 求教linux下debug的问题

请教下,为什么不直接用eclipse+cdt+gdb?
我没用过eclipse+gdb, 不过准备折腾一下试试, 不知道好不好使
t*****n
发帖数: 4908
40
来自主题: Programming版 - 求教linux下debug的问题
eclipse的UI对gdb反应太慢。next经常要等。还是emacs快。命令行gdb太白痴了。看个
代码都麻烦。emacs其实不难用。建议emacs用CUA mode。有了CUA,emacs和一般的编辑
器没什么区别。
X*K
发帖数: 87
41
来自主题: Programming版 - 求教linux下debug的问题
多加几句log就好了吧,本来程序里就应该已经有很多log了,调试的时候再加一些,其
中说不定有些有用还可以一直保留。还有很多时候也没法单步调试,比如多线程的很多
bug单步没法重现出来。
真要用gdb单步的话还是emacs+gdb方便
t*****n
发帖数: 4908
42
来自主题: Programming版 - 求教linux下debug的问题
log容易忽略细节,特别是函数间的调用关系。对我来说,log调试如同盲人摸象,gdb
如同庖丁解牛。当然各人理解不一定一样。我估计我用gdb和log调试的比例,大概在
100:1左右。
h*******s
发帖数: 8454
43
来自主题: Programming版 - 求教linux下debug的问题
我估计是不同的程序需求不同吧 我看身边的老年工程师好像也不用gdb
可能code都在脑子里 写一大堆test然后大概哪儿出问题仔细想想就知道了

gdb
j*****l
发帖数: 1624
44
来自主题: Programming版 - 求教linux下debug的问题
是硬件公司和硬件打交道的。能用gdb的时候肯定是用gdb,不能用的时候就打印。
要是是纯软件公司那大概就会高层吧。像我朋友在google哪怕是做android也是用
eclipse啊啊啊。
j*****l
发帖数: 1624
45
来自主题: Programming版 - 求教linux下debug的问题
对,我是打印了log之后,找到函数,然后再回gdb用bt来trace

gdb
a*********a
发帖数: 3656
46
来自主题: Programming版 - 以下两个C 代码是不是完全等价?
和编译器以及优化程度有关。具体的可以在gdb里看下汇编.
gdb> disassemble
w*s
发帖数: 7227
47
来自主题: Programming版 - a dummy OS question
各位大牛,容我尽力描述一下,请大家畅所欲言,非常感谢。
linux system, two rs485 ports, ~50 devices attached on these 2 ports.
~100 processes in the system from linux itself. 4 core arm.
in many sense it's like a linux desktop with our app running.
could get very busy, e.g. like the moment you open office in linux.
1. original design was like this, also tested well enough,
The main app has 10 threads on its own.
For each rs485, main process spawns off a process to monitoring all
devices on this
port. (Since this is se... 阅读全帖
S*A
发帖数: 7142
48
来自主题: Programming版 - a dummy OS question
3) kernel oops explain you can't get a coredump.
The coredump happen when the kernel receive a signal like
segfault. If your process is too mess up, e.g. the BAD PC
means your EIP is invalid value, most likely mess up your
stack, then there is no way the process can do core dump.
Just forget coredump, get back to the debug logging. If you
don't have debug logging, then you should add that to your
code. Yes, adding debug logging is a bit slow, but how is
using gdb any faster if yo... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)