Hallo
I want to send this command to gdb:
handle SIGPIPE nostop noprint pass
to ignore SIGPIPE.
I set it in my ~/.gdbinit, but Lazarus ignores it.
I tried write it to Debugger_Startup_Options, but without success.
Petr

Mailing lists / lazarus / 2013-06
9 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hallo
I want to send this command to gdb:
handle SIGPIPE nostop noprint pass
to ignore SIGPIPE.
I set it in my ~/.gdbinit, but Lazarus ignores it.
I tried write it to Debugger_Startup_Options, but without success.
Petr
the Debugger_Startup_Options, would be like
--eval-command="handle SIGPIPE nostop noprint pass"
if you are on windows IIRC gdb does not take this option.
that is even if you send it later ....
you can try by changing debugger/gdbmidebugger.pp
function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
line 4634 after
ExecuteCommand('-gdb-set language pascal', [cfCheckError]);insert
ExecuteCommand('handle SIGPIPE nostop noprint pass', [], [cfNoMiCommand, cfIgnoreState, cfExternal]);
see
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session for a log that contains all commands send to gdb
the Debugger_Startup_Options, would be like --eval-command="handle SIGPIPE nostop…
Thank you for the fast response. I try it, but I get this message: Debugger: Initialization output: &"Undefined command: \"\". Try \"help\".\n
In processes i have
/usr/bin/gdb -silent -i mi -nx --eval-command="handle SIGPIPE nostop noprint pass"
But gdb already stops on SIGPIPE.
If I try run
/usr/bin/gdb -silent -i mi -nx --eval-command="handle SIGPIPE nostop noprint pass" from bash, then it works ok.
Petr
Did you try single quotes ?
looks like the parts of the command line are not correctly broken into individual args.
Yes. With the same result.
I try to debug Debugger_Startup_Options: --eval-command="handle SIGPIPE nostop noprint pass" with strace and here is execve line:
[pid 20053] execve("/usr/bin/gdb", ["/usr/bin/gdb", "-silent", "-i", "mi", "-nx", "--eval-command=\"handle SIGPIPE nostop noprint pass\""], [/* 52 vars */]) = 0
IMHO it looks ok.
Petr
I don't think it should have the \", if the entire argument is quoted. but I am not sure
afaik/iirc the IDE passes this to TProcess (in fpc) and I do not know what happens there
however TProcess.Commandline is deprecated, afaik because arguments must be parsed... not sure.
In any case, I do not know how to solve, until the IDE stopped using the deprecated method / no time frame on that.
You can try my other suggestion and change the source....
Maybe the patch in http://bugs.freepascal.org/view.php?id=22751 can be a starting point?
Stephano
Hallo I want to send this command to gdb: handle SIGPIPE nostop noprint pass to ignore…
It may be a late reply, but for somebody interested: it is possible to achieve this by altering lazarus source file debugger/gdbmidebugger.pp (as previously mentioned by Martin). But line actually should be if (Assigned(FTheDebugger)) then
FTheDebugger.ExecuteCommand('handle SIGPIPE ignore noprint pass', [], [cfNoMiCommand, cfIgnoreState, cfExternal]);
after the "ExecuteCommand('-gdb-set language pascal', [cfCheckError]); " line.
In the Lazarus v1.0.12 this is somewhere near line 4344