This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[draft patch 3/6] Create empty common/linux-maps.[ch]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Aleksandar Ristovski <aristovski at qnx dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 10 Mar 2013 22:08:10 +0100
- Subject: [draft patch 3/6] Create empty common/linux-maps.[ch]
- References: <51278984.3070208@qnx.com>
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -771,7 +771,7 @@ LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
HFILES_NO_SRCDIR = \
common/gdb_signals.h common/gdb_thread_db.h common/gdb_vecs.h \
-common/i386-xstate.h common/linux-ptrace.h \
+common/i386-xstate.h common/linux-maps.h common/linux-ptrace.h \
proc-utils.h aarch64-tdep.h arm-tdep.h ax-gdb.h ppcfbsd-tdep.h \
ppcnbsd-tdep.h cli-out.h gdb_expat.h breakpoint.h infcall.h obsd-tdep.h \
exec.h m32r-tdep.h osabi.h gdbcore.h solib-som.h amd64bsd-nat.h \
@@ -1945,6 +1945,10 @@ format.o: ${srcdir}/common/format.c
$(COMPILE) $(srcdir)/common/format.c
$(POSTCOMPILE)
+linux-maps.o: ${srcdir}/common/linux-maps.c
+ $(COMPILE) $(srcdir)/common/linux-maps.c
+ $(POSTCOMPILE)
+
linux-osdata.o: ${srcdir}/common/linux-osdata.c
$(COMPILE) $(srcdir)/common/linux-osdata.c
$(POSTCOMPILE)
--- /dev/null
+++ b/gdb/common/linux-maps.c
@@ -0,0 +1,25 @@
+/* Linux-specific memory maps manipulation routines.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifdef GDBSERVER
+#include "server.h"
+#else
+#include "defs.h"
+#endif
+
+#include "linux-maps.h"
--- /dev/null
+++ b/gdb/common/linux-maps.h
@@ -0,0 +1,22 @@
+/* Linux-specific memory maps manipulation routines.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef COMMON_LINUX_MAPS_H
+#define COMMON_LINUX_MAPS_H
+
+#endif /* COMMON_LINUX_MAPS_H */
--- a/gdb/config/i386/linux.mh
+++ b/gdb/config/i386/linux.mh
@@ -3,7 +3,7 @@
NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
i386-nat.o i386-linux-nat.o \
- proc-service.o linux-thread-db.o \
+ proc-service.o linux-thread-db.o linux-maps.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o
NAT_CDEPS = $(srcdir)/proc-service.list
--- a/gdb/config/i386/linux64.mh
+++ b/gdb/config/i386/linux64.mh
@@ -1,7 +1,7 @@
# Host: GNU/Linux x86-64
NATDEPFILES= inf-ptrace.o fork-child.o \
i386-nat.o amd64-nat.o amd64-linux-nat.o \
- linux-nat.o linux-osdata.o \
+ linux-maps.o linux-nat.o linux-osdata.o \
proc-service.o linux-thread-db.o linux-fork.o \
linux-procfs.o linux-ptrace.o
NAT_FILE= config/nm-linux.h
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -510,6 +510,9 @@ ax.o: ax.c
signals.o: ../common/signals.c
$(COMPILE) $<
$(POSTCOMPILE)
+linux-maps.o: ../common/linux-maps.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
linux-procfs.o: ../common/linux-procfs.c
$(COMPILE) $<
$(POSTCOMPILE)
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -46,6 +46,7 @@ case "${target}" in
srv_regobj="aarch64.o aarch64-without-fpu.o"
srv_tgtobj="linux-aarch64-low.o"
srv_tgtobj="${srv_tgtobj} linux-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-maps.o"
srv_tgtobj="${srv_tgtobj} linux-osdata.o"
srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
@@ -61,7 +62,9 @@ case "${target}" in
srv_regobj="${srv_regobj} arm-with-vfpv2.o"
srv_regobj="${srv_regobj} arm-with-vfpv3.o"
srv_regobj="${srv_regobj} arm-with-neon.o"
- srv_tgtobj="linux-low.o linux-osdata.o linux-arm-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-arm-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_xmlfiles="arm-with-iwmmxt.xml"
srv_xmlfiles="${srv_xmlfiles} arm-with-vfpv2.xml"
@@ -84,19 +87,25 @@ case "${target}" in
srv_mingwce=yes
;;
bfin-*-*linux*) srv_regobj=reg-bfin.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-bfin-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-bfin-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
srv_linux_thread_db=yes
;;
crisv32-*-linux*) srv_regobj=reg-crisv32.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-crisv32-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-crisv32-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
cris-*-linux*) srv_regobj=reg-cris.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-cris-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-cris-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
srv_linux_thread_db=yes
@@ -111,7 +120,10 @@ case "${target}" in
srv_regobj="$srv_regobj $srv_amd64_linux_regobj"
srv_xmlfiles="${srv_xmlfiles} $srv_amd64_linux_xmlfiles"
fi
- srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-x86-low.o"
+ srv_tgtobj="${srv_tgtobj} i386-low.o i387-fp.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
@@ -146,12 +158,16 @@ case "${target}" in
srv_qnx="yes"
;;
ia64-*-linux*) srv_regobj=reg-ia64.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-ia64-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-ia64-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
;;
m32r*-*-linux*) srv_regobj=reg-m32r.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-m32r-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-m32r-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
srv_linux_thread_db=yes
@@ -161,7 +177,9 @@ case "${target}" in
else
srv_regobj=reg-m68k.o
fi
- srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-m68k-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
@@ -172,7 +190,9 @@ case "${target}" in
else
srv_regobj=reg-m68k.o
fi
- srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-m68k-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
@@ -182,7 +202,10 @@ case "${target}" in
srv_regobj="${srv_regobj} mips-dsp-linux.o"
srv_regobj="${srv_regobj} mips64-linux.o"
srv_regobj="${srv_regobj} mips64-dsp-linux.o"
- srv_tgtobj="linux-low.o linux-osdata.o linux-mips-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o"
+ srv_tgtobj="${srv_tgtobj} linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-mips-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_xmlfiles="mips-linux.xml"
srv_xmlfiles="${srv_xmlfiles} mips-dsp-linux.xml"
@@ -215,7 +238,9 @@ case "${target}" in
srv_regobj="${srv_regobj} powerpc-isa205-64l.o"
srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
- srv_tgtobj="linux-low.o linux-osdata.o linux-ppc-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-ppc-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_xmlfiles="rs6000/powerpc-32l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
@@ -261,7 +286,9 @@ case "${target}" in
srv_regobj="${srv_regobj} s390x-linux64.o"
srv_regobj="${srv_regobj} s390x-linux64v1.o"
srv_regobj="${srv_regobj} s390x-linux64v2.o"
- srv_tgtobj="linux-low.o linux-osdata.o linux-s390-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-s390-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_xmlfiles="s390-linux32.xml"
srv_xmlfiles="${srv_xmlfiles} s390-linux32v1.xml"
@@ -282,14 +309,18 @@ case "${target}" in
srv_linux_thread_db=yes
;;
sh*-*-linux*) srv_regobj=reg-sh.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-sh-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-sh-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
sparc*-*-linux*) srv_regobj=reg-sparc64.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-sparc-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-sparc-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_regsets=yes
srv_linux_thread_db=yes
@@ -306,14 +337,19 @@ case "${target}" in
srv_xmlfiles="${srv_xmlfiles} tic6x-core.xml"
srv_xmlfiles="${srv_xmlfiles} tic6x-gp.xml"
srv_xmlfiles="${srv_xmlfiles} tic6x-c6xp.xml"
- srv_tgtobj="linux-low.o linux-osdata.o linux-tic6x-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-tic6x-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_regsets=yes
srv_linux_usrregs=yes
srv_linux_thread_db=yes
;;
x86_64-*-linux*) srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj"
- srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-x86-low.o"
+ srv_tgtobj="${srv_tgtobj} i386-low.o i387-fp.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_xmlfiles="$srv_i386_linux_xmlfiles $srv_amd64_linux_xmlfiles"
srv_linux_usrregs=yes # This is for i386 progs.
@@ -332,13 +368,18 @@ case "${target}" in
;;
xtensa*-*-linux*) srv_regobj=reg-xtensa.o
- srv_tgtobj="linux-low.o linux-osdata.o linux-xtensa-low.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-xtensa-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_regsets=yes
;;
tilegx-*-linux*) srv_regobj=reg-tilegx.o
srv_regobj="${srv_regobj} reg-tilegx32.o"
- srv_tgtobj="linux-low.o linux-tile-low.o linux-osdata.o linux-procfs.o"
+ srv_tgtobj="linux-low.o linux-maps.o"
+ srv_tgtobj="${srv_tgtobj} linux-tile-low.o"
+ srv_tgtobj="${srv_tgtobj} linux-osdata.o"
+ srv_tgtobj="${srv_tgtobj} linux-procfs.o"
srv_tgtobj="${srv_tgtobj} linux-ptrace.o"
srv_linux_regsets=yes
srv_linux_thread_db=yes