> Send a “WXX” packet to indicate the program exited.
Thank you. Sending the "WXX"” packet to indicate the program exited worked. I received the following message at the lldb prompt.
Process 1 exited with status = 0
And now to restart the application I gave the 'run' command for which I received the error "'A' packet returned an error: -1". When I checked the simulator for this I found that the simulator didn't receive the 'A' packet.
When debugged the lldb, I found that the problem is with the platform that has been chosen for my target. I had made platform "gdb-server" as my default platform explicitly by modifying the "PlatformRemoteGDBServer::Initialize ()" method.
$ lldb --arch vliw workplace/app.elf
Current executable set to 'workplace/app.elf' (vliw).
(lldb) target list
* target #0: /home/chandra/app01/workplace/app.elf ( arch=vliw-unknown-unknown, platform=remote-gdb-server )
Since I was connecting the target simulator using the Process plugin 'gdb-remote', the platform "gdb-server" didn't come into picture of connecting the simulator.
(lldb) process connect --plugin gdb-remote connect://localhost:51000
The connection and the debugging happened through the 'gdb-remote' Process plugin. And the problem comes when I restart the program after it terminates with an exit status. I.e. When I give the 'run' command to restart the program, the platform "gdb-server" sends the argument packet 'A' for program launching. But there is no connection associated with the platform "gdb-server". Hence lldb gives the following error:
error: 'A' packet returned an error: -1
With my existing porting of lldb I am able to connect the simulator and successfully debug a program once. But I am not able to do the following:
1. Restart the program for debugging with disconnecting the connection.
LLDB doesn't currently support the restart packet ("RXX"). Feel free to add support for it.
2. Send launch command to the simulator from lldb.
The launch command will send the "A" packet which sends the program and arguments. I believe that LLDB will disconnect from the remote server when the process exits, though it doesn't need to.
Can't I support the above two features from the 'gdb-remote' Process plugin? Can you please suggest the way of supporting the above two features?
Currently the "restart" support uses lldb_private::Process primitives like Process::Kill() to kill the current program, then it will just call "Process::Launch()" again. We could modify lldb_private::Process with a few new calls:
We would need to query if the current process supports restarting so if you run the "process launch" command and the current process is alive, we would then need to try and restart.
So yes, this is possible, but we don't have any support for restart except for using the current Process primitives.