Skip to content

make debug broken on native #20265

@benpicco

Description

@benpicco

Description

The pyterm wrapper interferes with make debug. The additional pyterm args are always added the native parameters even when not pyterm is used.
As a workaround, you can set RIOT_TERMINAL=native on the command line.

Steps to reproduce the issue

Run make debug for any native app.

Expected results

% make -C examples/hello-world debug                                                                                                                                                                                                                                                                                 
make: Entering directory '/home/benpicco/dev/RIOT/examples/hello-world'
gdb -q --args /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf tap0
Reading symbols from /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf...
(gdb) r
Starting program: /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf tap0

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]                                                                                                                                                                                                                                                                                                                                                 
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
RIOT native interrupts/signals initialized.
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2024.01-devel-601-gfbae3)
Hello World!
You are running RIOT on a(n) native board.
This board features a(n) native MCU.

Actual results

% make -C examples/hello-world debug
make: Entering directory '/home/benpicco/dev/RIOT/examples/hello-world'
gdb -q --args /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf -ps /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf --process-args tap0
Reading symbols from /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf...
(gdb) r
Starting program: /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf -ps /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf --process-args tap0

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]                                                                                                                                                                                                                                                                                                                                                 
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
usage: /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf [-i <id>] [-d] [-e|-E] [-o] [-c <tty>] [-g <gpiochip>] [-i <id>] [-d] [-e|-E] [-o] [-c <tty>]

help: /home/benpicco/dev/RIOT/examples/hello-world/bin/native/hello-world.elf -h

Options:
    -h, --help
        print this help message
    -i <id>, --id=<id>
        specify instance id (set by config module)
    -s <seed>, --seed=<seed>
        specify srandom(3) seed (/dev/random is used instead of random(3) if
        the option is omitted)
    -d, --daemonize
        daemonize native instance
    -e, --stderr-pipe
        redirect stderr to file
    -E, --stderr-noredirect
        do not redirect stderr (i.e. leave sterr unchanged despite
        daemon/socket io)
    -o, --stdout-pipe
        redirect stdout to file (/tmp/riot.stdout.PID) when not attached
        to socket
    -c <tty>, --uart-tty=<tty>
        specify TTY device for UART. This argument can be used multiple
        times (up to UART_NUMOF)
    -g <gpio>, --gpio=<gpio>
        specify gpiochip device for GPIO access.
        This argument can be used multiple times.
        Example: --gpio=/dev/gpiochip0 uses gpiochip0 for port 0
[Inferior 1 (process 55075) exited with code 01]
(gdb)

Versions

introduced by #20172

Metadata

Metadata

Assignees

Labels

Platform: nativePlatform: This PR/issue effects the native platformType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions