Skip to content

fix(functions): add get_functions route and fix wrong endpoint call - #201

Open
alikhere wants to merge 1 commit into
c2siorg:mainfrom
alikhere:fix/functions-wrong-endpoint
Open

fix(functions): add get_functions route and fix wrong endpoint call#201
alikhere wants to merge 1 commit into
c2siorg:mainfrom
alikhere:fix/functions-wrong-endpoint

Conversation

@alikhere

@alikhere alikhere commented Apr 7, 2026

Copy link
Copy Markdown

PR Description

The Functions panel was calling /get_locals (which runs info locals in GDB — local variables of the current stack frame) instead of an endpoint that actually returns program functions. The panel was showing wrong data on every refresh, and there was no /get_functions route on the backend at all.

Three files changed, all following existing patterns:

  • Added POST /get_functions to main.py running info functions via GDB, same structure as every other route in the file
  • Added test_get_functions to flask_test.py — backend test count goes from 20 to 21
  • Fixed Functions.jsx to call /get_functions instead of /get_locals

How to test

Start a debug session with a compiled program, open the Functions panel and trigger a refresh.

  • Before: panel received output from info locals (local variable data)
  • After: panel receives output from info functions (program function list)

To verify the backend route directly:

curl -X POST http://127.0.0.1:10000/get_functions \
  -H 'Content-Type: application/json' \
  -d '{"name": "program"}'

Backend tests:

cd gdbui_server && python -m unittest discover -s tests
# 21 passed

Related Issue

Fixes #200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Functions panel fetches from /get_locals — showing wrong data

1 participant