public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Share code to disable ASR between GDB and gdbserver
@ 2015-01-09 22:19 Sergio Durigan Junior
  2015-01-09 22:19 ` [PATCH 1/2] Move safe_strerror to common/ Sergio Durigan Junior
  2015-01-09 22:19 ` [PATCH 2/2] Move code to disable ASR to nat/ Sergio Durigan Junior
  0 siblings, 2 replies; 17+ messages in thread
From: Sergio Durigan Junior @ 2015-01-09 22:19 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves, Gary Benson

Hi,

This patch series shares code to disable ASR (address space
randomization) between GDB and gdbserver.  Specifically, it shares
parts of the code of the following functions:

  - gdb/linux-nat.c:linux_nat_create_inferior
  - gdb/gdbserver/linux-low.c:linux_create_inferior

It creates a new file under nat/, named linux-personality.c.  This new
file contains some functions that disable ASR before the inferior is
created, and then create a cleanup that can be called at the end of
the *_create_inferior function to re-enable ASR.  This idea was
proposed by Gary, and it is possible because gdbserver now can make
use of exceptions and cleanups (thanks, Gary!).

Before being able to share this code, I had to struggle with
safe_strerror: the GDB code to disable ASR calls this function to
report an error, but gdbserver calls only strerror.  So, after some
time, I managed to share safe_strerror between both; the code now
lives in common/, and obeys the original separation between POSIX and
MingW systems.  Pedro pointed out that we could import the strerror
module from gnulib, which already addresses the same issues that our
safe_strerror does, and does a bit more.  However, this has already
been tried before (by Tom Tromey), and the result was not good.  For
more details, please read this thread:
<https://lists.gnu.org/archive/html/bug-gnulib/2013-11/msg00078.html>.
In the end, I decided to share safe_strerror between both GDB and
gdbserver.

I regtested this patch on Fedora 20 x86_64, and found no regressions.
I intend to check the patches separately in the tree.

OK to check in?

Sergio.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-01-19 19:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-09 22:19 [PATCH 0/2] Share code to disable ASR between GDB and gdbserver Sergio Durigan Junior
2015-01-09 22:19 ` [PATCH 1/2] Move safe_strerror to common/ Sergio Durigan Junior
2015-01-13 16:54   ` Pedro Alves
2015-01-13 20:48     ` Sergio Durigan Junior
2015-01-14 11:26       ` Pedro Alves
2015-01-15  7:05         ` Sergio Durigan Junior
2015-01-15  9:02           ` Pedro Alves
2015-01-16  0:04             ` Sergio Durigan Junior
2015-01-09 22:19 ` [PATCH 2/2] Move code to disable ASR to nat/ Sergio Durigan Junior
2015-01-13 17:11   ` Pedro Alves
2015-01-13 20:55     ` Sergio Durigan Junior
2015-01-14 11:32       ` Pedro Alves
2015-01-15  7:06         ` Sergio Durigan Junior
2015-01-16  0:04         ` Sergio Durigan Junior
2015-01-16 15:39   ` Ulrich Weigand
2015-01-16 16:47     ` [PATCH][commit] Fix regression on RHEL-5 systems (was: Re: [PATCH 2/2] Move code to disable ASR to nat/) Sergio Durigan Junior
2015-01-19 19:16       ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).