public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Trust readonly sections if target has memory protection
@ 2013-09-06  2:03 Yao Qi
  2013-09-06  2:03 ` [PATCH 1/3] set trust-readonly-sections off in test cases Yao Qi
                   ` (5 more replies)
  0 siblings, 6 replies; 63+ messages in thread
From: Yao Qi @ 2013-09-06  2:03 UTC (permalink / raw)
  To: gdb-patches

Hi,
When option "trust-readonly-sections" was introduced in this patch
http://www.sourceware.org/ml/gdb-patches/2002-01/msg00711.html, there
was the discussion to turn it on in default.  However, we didn't do
that because we have a concern that bad or buggy program may modify the
code on the non-memory protected system.  On the other hand, it is
highly recommended to turn this on in remote debugging.

I am wondering if we can teach GDB to trust read-only sections if it
knows the target system has memory protection.  For some targets, such
as linux, we know they do have memory protection.  This is what this
patch series tries to do.

This change improves GDB's out-of-box performance.  I wrote a
micro-benchmark to disassemble GDB in GDB in remote debugging
(native-gdbserver) on x86-linux, and collect the time usage
and the number of 'm' packets,

                    /wo patch     /w patch

time usage    :       0.44s        0.10
number of 'm' :       43157         4

As we can see, the number of RSP 'm' packet is reduced dramatically,
and the time usage is reduced to some extent.  In my experiment,
GDBserver is running natively, so connection speed is quite fast.  In
some slow connections, the improvement will be more.

This patch series only teach GDB to trust readonly sections on
GNU/Linux targets.  Some ancient Windows targets don't have memory
protection, so we can't let GDB to rust readoly sections on mingw
and cygwin target.

*** BLURB HERE ***

Yao Qi (3):
  set trust-readonly-sections off in test cases
  Trust readonly sections if target has memory protection
  Linux has memory protection.

 gdb/NEWS                                |    4 ++++
 gdb/arch-utils.c                        |    7 +++++++
 gdb/arch-utils.h                        |    2 ++
 gdb/doc/gdb.texinfo                     |   11 +++++++++--
 gdb/gdbarch.c                           |   24 ++++++++++++++++++++++++
 gdb/gdbarch.h                           |    6 ++++++
 gdb/gdbarch.sh                          |    3 +++
 gdb/linux-tdep.c                        |   10 ++++++++++
 gdb/target.c                            |   28 ++++++++++++++++++++--------
 gdb/testsuite/gdb.base/break-always.exp |    4 ++++
 gdb/testsuite/gdb.mi/mi-fill-memory.exp |    5 +++++
 11 files changed, 94 insertions(+), 10 deletions(-)

-- 
1.7.7.6

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

end of thread, other threads:[~2013-10-23 10:16 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-06  2:03 [PATCH 0/3] Trust readonly sections if target has memory protection Yao Qi
2013-09-06  2:03 ` [PATCH 1/3] set trust-readonly-sections off in test cases Yao Qi
2013-09-06  5:56   ` Eli Zaretskii
2013-09-06 17:23   ` Pedro Alves
2013-09-06  2:03 ` [PATCH 2/3] Trust readonly sections if target has memory protection Yao Qi
2013-09-06  6:05   ` Eli Zaretskii
2013-09-06  9:07     ` Yao Qi
2013-09-06  9:24       ` Eli Zaretskii
2013-09-06  2:03 ` [PATCH 3/3] Linux " Yao Qi
2013-09-06  5:57 ` [PATCH 0/3] Trust readonly sections if target " Eli Zaretskii
2013-09-06  8:24   ` Yao Qi
2013-09-06  8:45     ` Eli Zaretskii
2013-09-06 13:03       ` Joel Brobecker
2013-09-06 13:27         ` Yao Qi
2013-09-06 13:32         ` Eli Zaretskii
2013-09-06 14:17           ` Pierre Muller
     [not found]           ` <"000d01ceab0b$d53ae600$7fb0b200$@muller"@ics-cnrs.unistra.fr>
2013-09-06 14:38             ` Eli Zaretskii
2013-09-06 14:52           ` Joel Brobecker
2013-09-06 15:56             ` Eli Zaretskii
2013-09-06 18:10               ` Joel Brobecker
2013-09-06 18:36                 ` Eli Zaretskii
2013-09-06 13:00 ` Joel Brobecker
2013-09-08 12:04 ` [PATCH 0/7 V2] " Yao Qi
2013-09-08 12:04   ` [PATCH 1/7] Emit a warning when writing to a readonly section and trust_readonly is true Yao Qi
2013-09-08 15:10     ` Eli Zaretskii
2013-09-08 12:05   ` [PATCH 7/7] Windows has memory protection Yao Qi
2013-09-08 12:05   ` [PATCH 2/7] set trust-readonly-sections off in test cases Yao Qi
2013-09-08 12:05   ` [PATCH 4/7] Trust readonly sections if target has memory protection Yao Qi
2013-09-08 15:13     ` Eli Zaretskii
2013-09-09  7:49       ` Yao Qi
2013-09-09 16:25         ` Eli Zaretskii
2013-09-08 12:05   ` [PATCH 5/7] DOC and NEWS Yao Qi
2013-09-08 12:05   ` [PATCH 3/7] New function windows_init_abi Yao Qi
2013-09-08 12:05   ` [PATCH 6/7] Linux has memory protection Yao Qi
2013-09-09 19:16   ` [PATCH 0/7 V2] Trust readonly sections if target " Mark Kettenis
2013-09-10  4:06     ` Yao Qi
2013-09-12  8:30       ` Yao Qi
2013-09-12  9:49         ` Mark Kettenis
2013-09-13  8:17           ` Yao Qi
2013-09-30 17:50             ` Pedro Alves
2013-09-30 18:08               ` Pedro Alves
2013-10-07 22:29                 ` Stan Shebs
2013-10-08 12:18                   ` Pedro Alves
2013-10-08 12:47                     ` Abid, Hafiz
2013-10-08 13:34                       ` Pedro Alves
2013-10-08 13:36                       ` tmirza
2013-10-09  2:24               ` Doug Evans
2013-10-23 10:16                 ` Yao Qi
2013-10-15  0:44               ` Yao Qi
2013-09-20  2:47   ` [PATCH 0/7 V3] " Yao Qi
2013-09-20  2:47     ` [PATCH 4/7] Trust readonly sections if target has memory protection and in remote debugging Yao Qi
2013-09-20  2:47     ` [PATCH 5/7] DOC and NEWS Yao Qi
2013-09-20  8:21       ` Eli Zaretskii
2013-09-20  2:47     ` [PATCH 1/7] Emit a query when writing to a readonly section and trust_readonly is true Yao Qi
2013-09-20  2:47     ` [PATCH 2/7] set trust-readonly-sections off in test cases Yao Qi
2013-09-20  2:47     ` [PATCH 3/7] New function windows_init_abi Yao Qi
2013-09-30 18:23       ` Pedro Alves
2013-10-01  6:47         ` Yao Qi
2013-10-01  9:35           ` Pedro Alves
2013-10-01 13:23             ` Yao Qi
2013-09-20  2:47     ` [PATCH 7/7] Windows has memory protection Yao Qi
2013-09-20  2:47     ` [PATCH 6/7] Linux " Yao Qi
2013-09-29 13:51     ` [PATCH 0/7 V3] Trust readonly sections if target " Yao Qi

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).