From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: valid_pointer_p Date: Mon, 31 Jul 2006 06:21:52 +0300 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1154316136 27196 80.91.229.2 (31 Jul 2006 03:22:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 31 Jul 2006 03:22:16 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 31 05:22:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G7OM3-0005wf-6A for ged-emacs-devel@m.gmane.org; Mon, 31 Jul 2006 05:22:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G7OM2-00032c-Kw for ged-emacs-devel@m.gmane.org; Sun, 30 Jul 2006 23:22:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G7OLt-00032W-Lq for emacs-devel@gnu.org; Sun, 30 Jul 2006 23:21:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G7OLs-00032K-5s for emacs-devel@gnu.org; Sun, 30 Jul 2006 23:21:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G7OLs-00032H-36 for emacs-devel@gnu.org; Sun, 30 Jul 2006 23:21:56 -0400 Original-Received: from [192.114.186.20] (helo=nitzan.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G7OOR-0003R0-MA for emacs-devel@gnu.org; Sun, 30 Jul 2006 23:24:35 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-29-149.inter.net.il [80.230.29.149]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id EHQ36382 (AUTH halo1); Mon, 31 Jul 2006 06:21:50 +0300 (IDT) Original-To: storm@cua.dk (Kim F. Storm) In-reply-to: (storm@cua.dk) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57831 Archived-At: > Cc: emacs-devel@gnu.org > From: storm@cua.dk (Kim F. Storm) > Date: Mon, 31 Jul 2006 00:13:26 +0200 > > > It goes without saying that on MS-Windows, the code does segfault if > > the argument is an invalid pointer. > > .. but that's no worse than before I added pp / safe_debug_print. Yes, but that doesn't sound like a good argument to me. If we thing that segfaulting is a bug, let's fix it in the best way we can. > And do people usually debug emacs with GDB on windows? I do it all the time. What other debugger can I use to debug Emacs built with MinGW's port of GCC? Windows debuggers don't understand the debug info emitted by GCC. > > As for other ways, we could, for example, set up a temporary signal > > handler for SIGSEGV around the call to valid_pointer_p. That should > > work on most, if not all, supported platforms. > > > > Then there's the procfs API, which probably lets you actually read > > from the process memory on those platforms where procfs is available. > > > > On Windows, we could try reading from the address using the > > ReadProcessMemory API, which is used by debuggers. (If ptrace allows > > reading from the calling process, we could do the same on Posix > > platforms.) > > All of this sounds more or less complicated, but if someone want to > give one of these methods a try, fine with me. If no one else cares about this, I will at least write the code to DTRT on Windows. I could also show you the code to set up a signal handler, if you wish.