gdb: No symbol “i” in current context

后端 未结 6 479
谎友^
谎友^ 2021-02-02 10:02

While debugging a C program in gdb I have a breakpoint in a for loop. I cannot print the value of \"i\" ( I get : No symbol \"i\" in current context.). I can print the value of

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 10:29

    It has probably been optimised out of your compiled code as you only use feature_mask[i] within the loop.

    Did you specify an optimization level when you called your compiler? If you were using gcc, then just omit any -O options and try again.

提交回复
热议问题