dimanche 24 avril 2016

Debug into std::string in C++ linux

std::string str = "string";
char* pcStr = (char*)malloc(186);
for(int i=0;i<185;i++){
   pcStr[i]='a';
}
pcStr[185]='\0';
str.append(charstrptr);
free(pcStr);

is throwing SIGSEGV in append function. I want to debug into std::string::append to see whats going wrong. I've installed libstdc++-4.9-dev, libc++-dev. but when I debug the code in netbeans on ubuntu and try to step in the std::string::append then assembly is shown rather the append function source.

Aucun commentaire:

Enregistrer un commentaire