本文介绍了gdb是否显示C ++源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!



我在C ++可执行文件上运行gdb。我写的代码看起来像

这个:


itr = doc.GetFieldIterator();


而(itr.HasNext()){

Field field = itr.Current();

// Console.WriteLine(" Field name:{0}", field.GetName());

// printf(" Field name:%s \ n",(char *)field.GetName());

printf(" Hola%d \ n,i);

itr.Next();

i ++;

}

但是,gdb显示了一些非常不同的代码:


new_allocator()throw(){}

int i = 1;

inline Iterator():mp_impl(0){}

new_allocator()throw(){}

basic_string< _CharT,_Traits,_Alloc__str(__ lhs );

内联PDFDoc :: PDFDoc(const char * filepath){

basic_string< _CharT,_Traits,_Alloc__str(__ lhs);

{ return strlen(__ s); }

有什么方法可以让gdb显示更高级别的代码吗?


TIA,


-RFH


I am running gdb on a C++ executable. The code that I wrote looks like
this:

itr = doc.GetFieldIterator();

while (itr.HasNext()) {
Field field = itr.Current();
// Console.WriteLine("Field name: {0}", field.GetName());
// printf("Field name: %s\n", (char *)field.GetName());
printf("Hola %d\n", i);
itr.Next();
i++;
}
However, gdb shows some very different code:

new_allocator() throw() { }
int i = 1;
inline Iterator() : mp_impl(0) {}
new_allocator() throw() { }
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
inline PDFDoc::PDFDoc (const char* filepath) {
basic_string<_CharT, _Traits, _Alloc__str(__lhs);
{ return strlen(__s); }
Is there any way I can have gdb display higher level code?

TIA,

-RFH

推荐答案



首先查阅手册后,请咨询GDB新闻组论坛。

问题不在这里。

Consult a GDB newsgroup, forum, after first consulting the manual. The
question is off topic here.




没有gdb新闻组这样的东西。


你是说C ++开发人员对gdb一无所知和b / b
它对C ++代码的适用性?


我相信很多人都不同意。


-RFH


There is no such thing as a gdb newsgroup.

Are you saying that C++ developers do not know anything about gdb and
its applicability to C++ code?

I am sure a lot of people would like to disagree.

-RFH





没有gdb新闻组这样的东西。



There is no such thing as a gdb newsgroup.



有gcc新闻组。

comp.unix.programmer你也可能没问题,虽然我不能肯定。如果有的话,我会查看

他们的常见问题。

There are gcc newsgroups. You''d also probably be ok in
comp.unix.programmer, although I couldn''t say for certain. I''d review
their FAQ if available.



不,他说这是偏离主题的。请查看

主题指南的常见问题解答。

No, he''s saying it''s off-topic here. Please review the FAQ for
topicality guidelines.



有些会。那是无关紧要的。小组的共识是,

特定于平台的主题,包括编译器和

调试器等工具,在这里是偏离主题的。



Brian

Some would. That''s irrelevant. The group consensus is that
platform-specific topics, including tools such as compilers and
debuggers, are off-topic here.


Brian


这篇关于gdb是否显示C ++源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 08:30