@@ -31,6 +31,7 @@ public GdbStub(Debugger debugger, String binaryLocation) {
3131
3232 debugger .getBreakpointsListeners ().add ((pc ) -> {
3333 try {
34+ logger .info ("Stopped at breakpoint {}" , pc );
3435 sendPacket (out , "S05" );
3536 } catch (IOException e ) {
3637 throw new RuntimeException (e );
@@ -214,7 +215,7 @@ else if (pkt.startsWith("Z")) {
214215 debugger .addBreakpoint ((int ) addr );
215216
216217 try {
217- logger .info ("Breakpoint line {} {}" , debugSourceMap .getLineForPc ((int ) addr ), debugSourceMap .getSourceFileName ((int ) addr ));
218+ logger .info ("Add breakpoint at {}: {}" , debugSourceMap .getSourceFileName ((int ) addr ), debugSourceMap .getLineForPc ((int ) addr ));
218219 } catch (Exception _) {}
219220
220221 // A remote target shall return an empty string for an unrecognized breakpoint or watchpoint packet type.
@@ -231,8 +232,8 @@ else if (pkt.startsWith("z")) {
231232 debugger .removeBreakpoint ((int ) addr );
232233
233234 try {
234- logger .info ("Breakpoint line {} {}" , debugSourceMap .getLineForPc ((int ) addr ), debugSourceMap .getSourceFileName ((int ) addr ));
235- } catch (Exception e ) {}
235+ logger .info ("Remove breakpoint at {}: {}" , debugSourceMap .getSourceFileName ((int ) addr ), debugSourceMap .getLineForPc ((int ) addr ));
236+ } catch (Exception _ ) {}
236237
237238 // A remote target shall return an empty string for an unrecognized breakpoint or watchpoint packet type.
238239 sendPacket (out , "OK" );
@@ -274,8 +275,8 @@ else if (pkt.startsWith("stackInfo")) {
274275 sendPacket (out , result );
275276
276277 try {
277- logger .info ("Current line {} {}" , debugSourceMap .getLineForPc (state .getPc ()), debugSourceMap .getSourceFileName (state .getPc ()));
278- } catch (Exception e ) {}
278+ logger .info ("At {}: {}" , debugSourceMap .getSourceFileName (state .getPc ()), debugSourceMap .getLineForPc (state .getPc ()));
279+ } catch (Exception _ ) {}
279280
280281 break ;
281282 case "qC" : // Get thread id
@@ -303,6 +304,7 @@ else if (pkt.startsWith("stackInfo")) {
303304 sendStopPacket (out , "05" );
304305 break ;
305306 case "c" :
307+ logger .info ("Continue execution" );
306308 debugger .run ();
307309 break ;
308310 case "pause" :
0 commit comments