当前位置:  技术问答>linux和unix

how to debug in linux ?

    来源: 互联网  发布时间:2014-10-31

    本文导语:  I wrote a programmer with c++ under linux, it has a  Segmentation fault, how can i debug it with gdb? I compile them with g++ -p -g -c a.c;  when i run the programmer, it corrupt, and generate a file "core", I use gdb -c core, and type ...

I wrote a programmer with c++ under linux, it has a  Segmentation fault, how can i debug it with gdb? I compile them with g++ -p -g -c a.c; 
when i run the programmer, it corrupt, and generate a file "core", I use gdb -c core, and type "where", but it just show some address, how can i let it show somthing I can understand??


thanks a lot

|
generally speaking, core is a evil, remove it !
compile your program with command
g++ -Wall -p your_program_name.c -o whatever_name_you_want
then run gdb what_ever_name_you_want
then 
>b main /*set break point*/
then 
>run /*run the program*/
then
>n /star executing, then press enter after each step is executed*/

hope this can help you out =)

    
 
 

您可能感兴趣的文章:

  • how to input chinese in linux
  • how to uninstall the netscape6.2 in rh linux71
  • how can i install rpm files in linux?
  • how to use usb-storage in read hat linux?
  • On Line --100--Please tell me how to use QQ on linux??
  • How to telnet to linux9.0!! urgent!
  • how to find the linux shell source???
  • how to view user and group information on linux
  • how to install jbuilder7.0 on linux7.0
  • how to install program ! i'm a beginner in linux !:)
  • how to input Chinese in Redhat Linux 8 ?
  • how to use assembly language in c on (Linux platform) .............waiting online
  • How can the linux kernel get the value of a environment variable
  • how to use qq(or other char tool)in linux?Is there some softwares in linux?waiting on line.
  • linux下可以访问windows分区,但无法向其写入数据,why?how?
  • how to install an chinese "shurufa " in linux and make it work
  • how to use YAFFS nand file system in linux 2.6内核中
  • 我的win2000是ntfs格式的,在red hat 7.2 上怎么挂不上?说linux内核不支持ntfs?how to do ?
  • How to use the NTFS type for LINUX(FC5) OS? Help me! Thanks!
  • how can i append a text into text file(i am in linux,can't write chinese,sorry)
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • how to change Unicode to SJIS?
  • how to convert a OutputStream to a FileOutputStream??
  • how to use javamail to send email?
  • how to input chinese?
  • how to do it in java:'A'->65 和 65->'A'
  • UNIX下how to 查找所有的文件夹下的文件?
  • How to run Java applications ?
  • how to use sscanf?
  • how to logout
  • How to set tab behavior in emacs?
  • why can't i input chinese ? where? and how to do?
  • How to use "PATH"?
  • unix/linux知识 iis7站长之家
  • How to set proxy IP at Redhat8.0?
  • how to use chinese in redhat8.0
  • how to use the statement"reurn'in java?
  • how to update the mbr
  • how to avoid checking for new hardware on initializing?
  • how to compare two string
  • How to install Debian from Virtualbox
  • where can i download simsun, and how can i use it?
  • [Help!] I'm a green Hand ! How can i input Chinese ? Thanks!!!!!!!
  • how to write makefile 4files
  • how to use pi chu li(pinyin) command?
  • How do I get the parent JMenu for a JMenuItem
  • How to compile & install open office.org?
  • How to connecting internet by ADSL ?
  • Ugent! How to install VMware4 in Knoppix?
  • How can I get current system datetime?
  • how to insert multipart/alternative in multipart/mixed (javamail)
  • how can I get the tab key?


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3