Skip to content

gdbstub: command_name_matches compile error when GDBSTUB_SUPPORT_TASKS and GDBSTUB_RUNTIME are both disabled (IDFGH-17531) #18466

@mickeyl

Description

@mickeyl

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

6.0 (also present on master)

Espressif SoC revision.

ESP32S3

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

Custom Board

Power Supply used.

USB

What is the expected behavior?

The project should compile with CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME=n and CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=n (typical production config).

What is the actual behavior?

components/esp_gdbstub/src/gdbstub.c:833:16: error: implicit declaration of function 'command_name_matches' [-Wimplicit-function-declaration]
  833 |     } else if (command_name_matches("qSupported", cmd, 10)) {
      |                ^~~~~~~~~~~~~~~~~~~~

Steps to reproduce.

Set both CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME and CONFIG_ESP_GDBSTUB_SUPPORT_TASKS to n in sdkconfig. Build.

Root cause

In components/esp_gdbstub/src/gdbstub.c, the forward declaration of command_name_matches (line 43-45) is guarded by #if (CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME || CONFIG_ESP_GDBSTUB_SUPPORT_TASKS), but esp_gdbstub_handle_command calls it unconditionally (lines 833, 836). The definition (line 914) is also guarded.

The fix is to remove the #if guard from the forward declaration and definition, or guard the call sites as well.

Debug Logs.


Diagnostic report archive.

No response

More Information.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions