Skip to content

Disconnect button behaves differently across OSes with JLink GDB server #481

Description

@AndriiLishchynskyi

I have noticed that disconnect behaves differently on Win/Linux/Mac. On Windows after a disconnect(when request=attach) target gets halted regardless of the previous target state. On the other hand, on Linux/Mac detach resumes the target.

This is reproducible on PSoC6 devices.

I did some analysis and here are my observations:

  1. It is not reproducible with OpenOCD(Cypress version), probably because 'Detach' is implemented there. If we are talking about JLink GDB server - it does not support detach command.

  2. When JLink GDB shuts down "correctly" (exited, but not killed), it resumes the target. Based on the logs (attached) it looks like on Linux/Mac it shuts down "correctly", while on Windows it is just killed. The following message in JLink log indicate GDB was exited properly: "Restoring target state and closing J-Link connection..."

  3. If I am launching "Cortex-Debug" debugging on Windows, I see that detach hangs at this line of code preventing GDB server from shutting down "correctly":

    await this.sendCommand('target-detach');

  4. The issue is not something new, I have tried even very old Cortex-Debug versions.

Attached logs GDB traces and JLInk GDB server logs.
jlink_attach_detach_gdb_traces_ubuntu.txt
jlink_attach_detach_gdb_traces_win.txt
jlink_attach_detach_ubuntu.txt
jlink_attach_detach_win.txt

I am using:
VSCode-1.60.0
Cortex-Debug-v0.4.4
JLink_V754

So, the question: is it possible to unify behavior across OSes (I believe the proper one is to resume target upon detach)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions