Skip to content

Commit

Permalink
Merge branch 'gdbstub/unused_handle' into 'master'
Browse files Browse the repository at this point in the history
gdbstub: fixed build-error due to potentially uninitialized variable on -O2

Closes IDFGH-8213

See merge request espressif/esp-idf!19939
  • Loading branch information
ESP-Marius committed Sep 5, 2022
2 parents a565f06 + f4a220b commit 0ecf0af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/esp_gdbstub/src/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ static bool get_task_handle(size_t index, TaskHandle_t *handle)
static eTaskState get_task_state(size_t index)
{
eTaskState result = eReady;
TaskHandle_t handle;
TaskHandle_t handle = NULL;
get_task_handle(index, &handle);
if (gdb_debug_int == false) {
result = eTaskGetState(handle);
Expand All @@ -858,7 +858,9 @@ static eTaskState get_task_state(size_t index)
static int get_task_cpu_id(size_t index)
{
TaskHandle_t handle;
get_task_handle(index, &handle);
if (!get_task_handle(index, &handle)) {
return -1;
}
BaseType_t core_id = xTaskGetAffinity(handle);
return (int)core_id;
}
Expand Down

0 comments on commit 0ecf0af

Please sign in to comment.