Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread awareness is not available on QEMU targets #60863

Closed
bdmendes opened this issue Jul 27, 2023 · 2 comments
Closed

Thread awareness is not available on QEMU targets #60863

bdmendes opened this issue Jul 27, 2023 · 2 comments
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@bdmendes
Copy link
Contributor

bdmendes commented Jul 27, 2023

Describe the bug

gdb is unable to show threads list while debugging an executable on Zephyr QEMU targets. Instead of full thread list only the one running thread (current thread) is shown.

This is only an issue with the various Zephyr QEMU targets; thread awareness works as expected with the hardware targets I have tested, through OpenOCD.

To Reproduce

Steps to reproduce the behavior:

  1. west build -b qemu_x86 zephyr/samples/philosophers/
  2. ninja debugserver
  3. [zephyrsdk path]/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gdb zephyr/build/zephyr/zephyr.elf
  4. Halt execution and issue info threads
  5. See only one running thread

Expected behavior

A complete list of all program threads shown, preferably with their name and priority.

Impact

This makes it harder to debug highly concurrent applications for issues such as thread synchronization.

Logs and console output

Expected output (example from board iotdk):

west debug
(gdb) continue
(gdb) ^C
(gdb) info threads
  Id   Target Id                                                                   Frame
* 2    Thread 2147484656 "idle" (Name: idle, prio:40,useropts:1)                   arch_cpu_idle ()
    at /home/mendesb/zephyrproject/zephyr/arch/arc/core/cpu_idle.S:49
  3    Thread 2147484368 "Philosopher 5" (Name: Philosopher 5, prio:-2,useropts:4) 0x00003ce2 in ?? ()
  4    Thread 2147484224 "Philosopher 4" (Name: Philosopher 4, prio:-1,useropts:4) 0x00003ce2 in ?? ()
  5    Thread 2147484080 "Philosopher 3" (Name: Philosopher 3, prio:0,useropts:4)  0x00003ce2 in ?? ()
  6    Thread 2147483936 "Philosopher 2" (Name: Philosopher 2, prio:1,useropts:4)  0x00003ce2 in ?? ()
  7    Thread 2147483792 "Philosopher 1" (Name: Philosopher 1, prio:2,useropts:4)  0x00003ce2 in ?? ()
  8    Thread 2147483648 "Philosopher 0" (Name: Philosopher 0, prio:3,useropts:4)  0x00003ce2 in ?? ()

Actual output from qemu_x86:

(gdb) continue
(gdb) ^C
(gdb) info threads
  Id   Target Id                    Frame
* 1    Thread 1.1 (CPU#0 [running]) 0xe61db94c in ?? ()

Environment

  • OS: Ubuntu 22.04
  • Toolchain: Zephyr SDK
  • Zephyr Commit SHA: fe15f77
@bdmendes bdmendes added the bug The issue is a bug, or the PR is fixing a bug label Jul 27, 2023
@github-actions
Copy link

Hi @bdmendes! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@bdmendes
Copy link
Contributor Author

Moved to zephyrproject-rtos/sdk-ng#691 since this should be an SDK-related issue

@bdmendes bdmendes closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

1 participant