Code: Select all
// hello_world_main.c
#include <stdio.h>
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#define LED 10
int led_status = 0;
void led_init()
{
gpio_reset_pin(LED);
gpio_set_direction(LED, GPIO_MODE_OUTPUT);
}
void led_blink()
{
led_status = (led_status + 1) % 2;
gpio_set_level(LED, led_status);
}
void app_main()
{
led_init();
while (1)
{
led_blink();
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
}
每次使用 continue 全速运行,程序停在断点位置
此时 GDB 不会打印当前行号以及本行代码,而是出现出现以下情况
Code: Select all
(gdb) c
Continuing.
Thread 2 "main" received signal SIGTRAP, Trace/breakpoint trap.
0x00000000 in ?? ()