Skip to content

Commit

Permalink
command: Ditched the nasty stack buffer in preference for direct form…
Browse files Browse the repository at this point in the history
…atting the probe information out to GDB for the version command
  • Loading branch information
dragonmux committed Oct 6, 2024
1 parent 62c100b commit eb0058a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ bool cmd_version(target_s *target, int argc, const char **argv)
(void)argc;
(void)argv;
#if PC_HOSTED == 1
char ident[256];
gdb_ident(ident, sizeof(ident));
gdb_out("Black Magic Debug App " FIRMWARE_VERSION "\n");
gdb_outf("Using a %s\n", ident);
bmda_display_probe();
#else
#ifndef PLATFORM_IDENT_DYNAMIC
gdb_out(BOARD_IDENT);
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/hosted/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ static uint32_t max_frequency = 4000000U;

static bmda_cli_options_s cl_opts;

void gdb_ident(char *p, int count)
void bmda_display_probe(void)
{
snprintf(p, count, "%s (%s), %s", bmda_probe_info.manufacturer, bmda_probe_info.product, bmda_probe_info.version);
gdb_outf("Using a %s (%s), %s\n", bmda_probe_info.product, bmda_probe_info.manufacturer, bmda_probe_info.version);
}

static void exit_function(void)
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/hosted/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef enum probe_type {
PROBE_TYPE_GPIOD,
} probe_type_e;

void gdb_ident(char *p, int count);
void bmda_display_probe(void);

#ifdef ENABLE_GPIOD
#include "bmda_gpiod_platform.h"
Expand Down

0 comments on commit eb0058a

Please sign in to comment.