eclipse-cdt-cloud / cdt-gdb-adapter

CDT GDB Debug Adapter
Eclipse Public License 2.0
28 stars 40 forks source link

Support terminate request in debug adapter #256

Closed QuocDoBV closed 1 year ago

QuocDoBV commented 1 year ago

When restart request is called, the disconnectRequest() and launchRequest() will be called. In the disconnectRequest() will send a '-gdb-exit' command to exit GDB server then the launch method will be called to start a new GDB server. But LaunchRequest() is not wait for GDB server is terminated completely to run and start a new GDB server. In this case, Emulator is still being held by old GDB server, So cannot start a new GDB server. Solution: Make a delay to wait for GDB server is terminated completely.

QuocDoBV commented 1 year ago

Hi @jonahgraham-san, Could you help me review the PR? Thank you!

QuocDoBV commented 1 year ago

Hi @jonahgraham, Could you please help me review the new code? Thank you!

QuocDoBV commented 1 year ago

Hi @jonahgraham-san, Could you help me review again? About IT I will commit once the solution is accepted.

QuocDoBV commented 1 year ago

Hi @jonahgraham, Could you please help me review again? Thank you!

QuocDoBV commented 1 year ago

Hi @jonahgraham, I have implemented terminate request in debug adapter and updated some code. Could you please help me review it? Thank you!

QuocDoBV commented 1 year ago

Hi @jonahgraham-san, Could you please help me confirm about my comment? To GDB server exits completely and emulator resets after GDB exits we need to wait some times. If we try to kill the gdb server immediately after sending "-gdb-exit" the emulator will be crash and need reset emulator to can connect in the next time. I check with the change in https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/pull/258/files we cannot connect to debugger again if does not reset emulator. With Renesas E2 emulator need about more 3s to gdb server can exit gracefully and leave emulator for the next connection complete. If not do so emulator will be hanged. image

jonahgraham commented 1 year ago

Solution replaced by #260