From bb6516408ec13cbfca0d70a8ebffd803d42173ed Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Sat, 2 Nov 2024 07:12:03 +0000 Subject: [PATCH] wrap rr macros restart and jump in python fixes #3859 warnings during startup --- src/launch_debugger.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/launch_debugger.cc b/src/launch_debugger.cc index a0e1bb86509..02cef9c15a9 100644 --- a/src/launch_debugger.cc +++ b/src/launch_debugger.cc @@ -48,9 +48,10 @@ static const string& gdb_rr_macros() { if (s.empty()) { stringstream ss; ss << DebuggerExtensionCommandHandler::gdb_macros() - << "define restart\n" - << " run c$arg0\n" - << "end\n" + // gdb warns about redefining inbuilt commands, silence that by + // wrapping it in python code + << "python gdb.execute('define jump\nrr-denied jump\nend')" + << "python gdb.execute('define restart\nrun c$arg0\nend')" << "document restart\n" << "restart at checkpoint N\n" << "checkpoints are created with the 'checkpoint' command\n" @@ -61,9 +62,6 @@ static const string& gdb_rr_macros() { << "document seek-ticks\n" << "restart at given ticks value\n" << "end\n" - << "define jump\n" - << " rr-denied jump\n" - << "end\n" // In gdb version "Fedora 7.8.1-30.fc21", a raw "run" command // issued before any user-generated resume-execution command // results in gdb hanging just after the inferior hits an internal