gdb for循环无法打印
- C/C++ code
g_MySQLAdmin.Query(sql,myvvs); for(int j =0; j < myvvs.size() ; j++) { string title= vvs[i][2]; if( myvvs.size() != 1) { title+= "["; title+=CConvert::IntToStr(j+1); title+="]"; }
- C/C++ code
71 {72 string title= vvs[i][2];73 if( myvvs.size() != 1)74 {75 title+= "[";76 title+=CConvert::IntToStr(j+1);77 title+="]";78 }79 string mysql = "INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_status`, `comment_status`, `ping_status`, `post_name`, `post_modified`, `post_modified_gmt`, `post_parent`, `guid`, `menu_order`, `post_type`, `comment_count`, `post_excerpt` , `to_ping`,`pinged`,`post_content_filtered` ) VALUE ( '1', now(), now(), '";80 mysql+= myvvs[i][0];(gdb) bt#0 main () at insert.cpp:76(gdb) p titleNo symbol "title" in current context.(gdb) p myvvsNo symbol "myvvs" in current context.(gdb) p i$3 = 0
[解决办法]
你调试的二进制物件和源代码对应吗?源代码不对应有可能会出现这种情况。
[解决办法]
遇到过怎么也断不下来的,没遇到过p无堆栈信息的。
[解决办法]
不好说
你的gcc和gdb版本?
用的什么编译开关
尝试
1) -fno-omit-frame-pointer
2) -g -> -g3
3) -g -> -ggdb3
4) 去掉一些华丽的链接开关