-
Notifications
You must be signed in to change notification settings - Fork 8.1k
runners: Add lldbac runner for run-lldbac debugging #97635
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
base: main
Are you sure you want to change the base?
runners: Add lldbac runner for run-lldbac debugging #97635
Conversation
424e3aa
to
85f5fbb
Compare
b83a976
to
7bb4d56
Compare
|
Re-assigning because I have zero experience with ARC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start, but it seems to need some more work/discussion/testing.
E.g. on Windows I had to change the name of the command to "run-lldbac.bat" to ensure the executable (script) was found.
|
||
def __init__(self, cfg, props, tcf=None, hardware=False, board_json=None, gui=False): | ||
super().__init__(cfg) | ||
self.lldbac_cmd = ['run-lldbac'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.lldbac_cmd = ['run-lldbac'] | |
self.lldbac_cmd = [shutil.which('run-lldbac')] |
shutil.which()
automatically appends .bat
or .exe
on Windows, which solves the Windows problem reported by @ruuddw in #97635 (review)
This is already used in dozens of places in this repo.
(I have not looked at the code; I only saw @ruuddw 's comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip @marc-hb!
Introduce a new Zephyr runner, `lldbac`, providing interactive debugging for both nSIM (simulator) and physical hardware using the run-lldbac tool from Synopsys ARC MWDT. This runner provides two distinct operation modes: 1. Integrated mode (debug/flash): Runner manages debug server internally via run-lldbac wrapper tool 2. Client-only mode (debugserver): Connect lldbac client to externally managed GDB server (works for both simulator and hardware) Key features: - Hardware mode: Flash and debug on physical hardware using JTAG flags (requires --jtag-device parameter) - Simulator mode: Interactive debugging on nSIM using run-lldbac with --nsim flag (props or --tcf). Enable with --simulator flag. - Board-driven config: Boards can specify defaults in board.cmake - TCF support: Optional --tcf for simulator mode (mutually exclusive with --nsim-props) - GUI support: Optional --gui flag for VS Code debugging - Client-only mode: Connect to pre-started GDB server for advanced workflows and remote debugging Runner capabilities: - flash: Available for hardware only (simulator should use arc-nsim) - debug: Available for both simulator and hardware (integrated mode) - debugserver: Connect to existing GDB server (client-only mode) Hardware configuration (flag-based): - --jtag-device: JTAG device name (required, e.g., JtagHs2) - --jtag: JTAG adapter type (default: jtag-digilent) - --jtag-frequency: JTAG clock frequency (default: 500KHz) Simulator configuration: - --simulator: Enable simulator mode (required) - --nsim-props: nSIM properties file path - --tcf: Tool Configuration File (alternative to --nsim-props) Client-only mode: - --gdb-host: GDB server hostname/IP (default: localhost) - --gdb-port: GDB server port (default: 3333) The debugserver command uses raw `lldbac` instead of `run-lldbac` to avoid automatic platform connection, enabling clean client-only operation for remote debugging and advanced workflows. Signed-off-by: Afonso Oliveira <[email protected]>
Add lldbac runner configuration to arc_v nSIM board family for simulator debugging with run-lldbac tool. Configure --nsim-props argument using the same NSIM_PROPS variable as arc-nsim runner for consistency. This enables the lldbac runner to use the board-specific nSIM properties for simulator mode debugging. The lldbac runner supports both simulator and hardware modes, with simulator mode being enabled via the --simulator flag. For hardware debugging, users need to provide --board-json configuration separately. Signed-off-by: Afonso Oliveira <[email protected]>
Add comprehensive documentation for using the lldbac runner with arc_v nSIM board targets, covering simulator and hardware debugging workflows. Signed-off-by: Afonso Oliveira <[email protected]>
7bb4d56
to
71111bf
Compare
This PR introduces a new Zephyr runner
lldbac
that provides interactive debugging support for ARC-V targets using therun-lldbac
tool from Synopsys ARC MetaWare Development Toolkit (MWDT).The runner supports both simulator (nSIM) and physical hardware debugging. For simulator mode, it uses
--nsim
with board-configured properties or optional--tcf
files. For hardware mode, it provides flash and debug capabilities via board.json JTAG configuration. Hardware mode requires explicit--board-json
argument to prevent accidental misconfigurations.The
debug
command is available for both simulator and hardware, whileflash
is hardware-only (simulator users should use the existingarc-nsim
runner for non-interactive execution). TCF and props are mutually exclusive for simulator mode, with TCF taking precedence if both are specified.Example usage:
Tested on
nsim_arc_v/rmx100
board target.