From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3360 invoked by alias); 30 Jun 2007 17:28:50 -0000 Received: (qmail 3352 invoked by uid 22791); 30 Jun 2007 17:28:49 -0000 X-Spam-Check-By: sourceware.org Received: from mail.artimi.com (HELO mail.artimi.com) (194.72.81.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 30 Jun 2007 17:28:47 +0000 Received: from rainbow ([192.168.8.46]) by mail.artimi.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 30 Jun 2007 18:27:01 +0100 From: "Dave Korn" To: "'Michael Snyder'" , References: <003c01c7ba81$2abc9ce0$677ba8c0@sonic.net> Subject: RE: libSegFault and just in time debugging Date: Sat, 30 Jun 2007 17:28:00 -0000 Message-ID: <007601c7bb3b$dde90910$2e08a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <003c01c7ba81$2abc9ce0$677ba8c0@sonic.net> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00360.txt.bz2 On 29 June 2007 20:11, Michael Snyder wrote: > What if, instead of doing that, libSegFault (or another similar library) > were to open a socket to a daemon and say "I caught a crash -- what > do you want me to do?". And then wait for a reply. All that can be > done with async-signal-safe function calls. > > The daemon, because it is NOT in a signal handler, can do anything > it wants, eg. open a GUI window and say "Program XYZ has crashed: > would you like to debug it?" User clicks a button, daemon fires up > gdb, attaches to crashing program, then responds to the signal handler > library with a message saying "get out of the way, please...". The > library removes itself from the signal vector, re-raises the signal, > and returns. And gdb finds itself at the point where the signal was > originally raised. Implementation-wise, wouldn't it be easier to just build a mini-gdbserver[*] into libsegfault itself? It would save having to do the get-out-of-the-way dance. cheers, DaveK [*] - sorry, vague terminology here - i mean a remote protocol talker, like the embedded targets use, not the big i'm-a-separate-process gdbserver. -- Can't think of a witty .sigline today....