gcc -g :what will happen

后端 未结 7 1039
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 00:51

This question was asked to me in an interview.

they asked me how to generate a core dump file with which i can debug. then i said that with -g flag in

相关标签:
7条回答
  • 2021-01-30 01:46

    core dump is one of a process´s default actions, when this process receives the signals, e.g. in the standard signals "SIGQUIT", "SIGILL", "SIGABRT", "SIGFPE", "SIGSEGV". However, most shells suppress the creation of core file, simply because the core files tend to be large and it can take some time or a lot of time.

    in order to enable the core generation, "ulimit" is the utility that you can use to set the shell or its children process´s file limit.

    compiler flags "-g" or whatever only concern with compiler. logically speaking, it has nothing to do with core dump.

    0 讨论(0)
提交回复
热议问题