What gdb commands should I use to narrow down where in label 'main' did I get the segmentation fault?

后端 未结 1 1704
鱼传尺愫
鱼传尺愫 2021-01-26 17:48

Here\'s my assembly code and my main subroutine. Here are my macros and constants:

             .text
fmt:         .string \"x \\t\\t ln(x)\\n\"
sfmt:        .st         


        
相关标签:
1条回答
  • 2021-01-26 18:04

    Turns out your main is in the .bss section, not .text where it belongs, so it can only contain all-zero bytes. (And it won't be executable).

    GDB normally only wants to disassemble code in the .text section so that also explains GDB being weird.

    This is why you should reduce your code to a MCVE (Minimal / complete / verifiable example) to make it as small as possible while still containing the problem.

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