Hello prasanna.rawke@carnot.co.in,
The debugger writes to the ARM Debug system registers
Arm®v7-M Architecture Reference Manual | Arm®v7-M Architecture Reference Manual – Arm Developer
C1.6 Debug system registers
But as far as I know, when the debugger gets disconnected, none of them reflects that.
However, when the debugger is active, you can see it on the bus.

JTAG_TDI pin (PTC5) has a pullup enabled by default.
So, when the debugger is disconnected, PTC_PDIR[5] should read high constantly.
BR, Daniel