emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: valid_pointer_p


From: Eli Zaretskii
Subject: Re: valid_pointer_p
Date: Mon, 31 Jul 2006 06:21:52 +0300

> Cc: address@hidden
> From: address@hidden (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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]