Due to my ongoing work to make it possible for gdbserver to start the
inferior using the shell, I had to share the fork_inferior function
under the "nat/" directory. In order to do that, I created a new file
and put the function there; however, this meant that I now had to
update some of the *.mh files (under "gdb/config") and add the new
file as a dependency to be built natively. Bleh...
After talking a bit to Pedro about this, the idea came up to write a
new "gdb/configure.nat" file, a la "gdb/configure.tgt", which would
concentrate all of the native settings for each host/system. I
decided to tackle this issue.
The patch is simple. All of the previous Makefile variables that were
being declared inside the *.mh files are now inside "gdb/Makefile.in",
and "gdb/configure" is responsible for AC_SUBST'ing them. The
definitions of these variables were put inside "gdb/configure.nat", so
now they're shell variables. For excerpts of Makefile code, one must
create a file under "gdb/config/${gdb_cpu_host}" and reference it on
the "nat_extra_makefile_frag" variable.
It should now be easier to update the native dependencies of hosts in
this single file.
This has been tested on x86_64 without regressions.
gdb/ChangeLog:
2017-05-06 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in: Remove "@host_makefile_frag@". Add variables
NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS,
NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_HOST. Add
"@nat_extra_makefile_frag@".
(Makefile): Remove dependency on "@frags@".
($(GNULIB_BUILDDIR)/Makefile): Likewise.
(data-directory/Makefile): Likewise.
* config/aarch64/linux.mh: Deleted; moved contents to
"gdb/configure.nat".
* config/alpha/alpha-linux.mh: Likewise.
* config/alpha/nbsd.mh: Likewise.
* config/arm/linux.mh: Likewise.
* config/arm/nbsdelf.mh: Likewise.
* config/i386/cygwin.mh: Likewise.
* config/i386/cygwin64.mh: Likewise.
* config/i386/darwin.mh: Likewise.
* config/i386/fbsd.mh: Likewise.
* config/i386/fbsd64.mh: Likewise.
* config/i386/go32.mh: Likewise.
* config/i386/i386gnu.mh: Likewise.
* config/i386/i386sol2.mh: Likewise.
* config/i386/linux.mh: Likewise.
* config/i386/linux64.mh: Likewise.
* config/i386/mingw.mh: Likewise.
* config/i386/mingw64.mh: Likewise.
* config/i386/nbsd64.mh: Likewise.
* config/i386/nbsdelf.mh: Likewise.
* config/i386/nto.mh: Likewise.
* config/i386/obsd.mh: Likewise.
* config/i386/obsd64.mh: Likewise.
* config/i386/sol2-64.mh: Likewise.
* config/ia64/linux.mh: Likewise.
* config/m32r/linux.mh: Likewise.
* config/m68k/linux.mh: Likewise.
* config/m68k/nbsdelf.mh: Likewise.
* config/m68k/obsd.mh: Likewise.
* config/m88k/obsd.mh: Likewise.
* config/mips/fbsd.mh: Likewise.
* config/mips/linux.mh: Likewise.
* config/mips/nbsd.mh: Likewise.
* config/mips/obsd64.mh: Likewise.
* config/pa/linux.mh: Likewise.
* config/pa/nbsd.mh: Likewise.
* config/pa/obsd.mh: Likewise.
* config/powerpc/aix.mh: Likewise.
* config/powerpc/fbsd.mh: Likewise.
* config/powerpc/linux.mh: Likewise.
* config/powerpc/nbsd.mh: Likewise.
* config/powerpc/obsd.mh: Likewise.
* config/powerpc/ppc64-linux.mh: Likewise.
* config/powerpc/spu-linux.mh: Likewise.
* config/s390/linux.mh: Likewise.
* config/sh/nbsd.mh: Likewise.
* config/sparc/fbsd.mh: Likewise.
* config/sparc/linux.mh: Likewise.
* config/sparc/linux64.mh: Likewise.
* config/sparc/nbsd64.mh: Likewise.
* config/sparc/nbsdelf.mh: Likewise.
* config/sparc/obsd64.mh: Likewise.
* config/sparc/sol2.mh: Likewise.
* config/tilegx/linux.mh: Likewise.
* config/vax/nbsdelf.mh: Likewise.
* config/vax/obsd.mh: Likewise.
* config/xtensa/linux.mh: Likewise.
* config/i386/i386gnu.mn: New file, with excerpts from
"config/i386/i386gnu.mh".
* configure: Regenerate.
* configure.ac: Rewrite code to use "gdb/configure.nat" instead of
*.mh files under "gdb/config".
* configure.nat: New file, with contents from the
"gdb/config/*/*.mh" files.
gdb/doc/ChangeLog:
2017-05-06 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile: Remove "@host_makefile_frag@".
FreeBSD last shipped a release for Alpha (6.3) in 2008.
This also removes support for GNU/kFreeBSD on Alpha.
gdb/ChangeLog:
* Makefile.in (ALL_64_TARGET_OBS): Remove alpha-fbsd-tdep.o.
(ALLDEPFILES): Remove alpha-fbsd-tdep.c
* NEWS: Mention that support for FreeBSD/alpha was removed.
* alpha-fbsd-tdep.c: Delete file.
* config/alpha/fbsd.mh: Delete file.
* configure.host: Delete alpha*-*-freebsd* and
alpha*-*-kfreebsd*-gnu.
* configure.tgt: Delete alpha*-*-freebsd* and
alpha*-*-kfreebsd*-gnu.
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.
gdb/ChangeLog:
Update copyright year range in all GDB files.
This patch rotates the GDB main ChangeLog file as per our "Start
of New Year Procedure".
2017-01-01 Joel Brobecker <brobecker@adacore.com>
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2016.
..., so handle these in "C" mode still:
gdb/
* config/i386/i386gnu.mh (%_S.o %_U.o): Add "-x c" to
"COMPILE.post".
* gnu-nat.c: #include Mach/Hurd headers before all others. Wrap
Mach/Hurd headers and MIG stubs' prototypes in 'extern "C"'.
* i386-gnu-nat.c: Likewise.
Move the debug register support code from amd64bsd-nat.c and
i386bsd-nat.c into a shared x86bsd-nat.c.
Instead of setting up x86_dr_low in amd64fbsd-nat.c and
i386fbsd-nat.c, add a x86bsd_target function that creates a new target
that inherits from inf_ptrace and sets up x86 debug registers if
supported. In addition to initializing x86_dr_low, the x86bsd target
installs a custom mourn_inferior target operation to clean up the
x86 debug register state. Previously this was only done on amd64.
Now it will be done for both i386 and amd64. The i386bsd_target and
amd64bsd_target functions create targets that inherit from x86bsd
rather than inf_ptrace.
gdb/ChangeLog:
* Makefile.in [HFILES_NO_SRCDIR]: Replace 'amd64bsd-nat.h' with
'x86bsd-nat.h'.
* amd64bsd-nat.c: Include 'x86bsd-nat.h' instead of
'amd64bsd-nat.h'.
(amd64bsd_xsave_len): Rename and move to x86bsd-nat.c.
(amd64bsd_fetch_inferior_registers): Replace 'amd64bsd_xsave_len'
with 'x86bsd_xsave_len'.
(amd64bsd_store_inferior_registers): Likewise.
(amd64bsd_target): Inherit from x86bsd_target.
(amd64bsd_dr_get): Rename and move to x86bsd-nat.c.
(amd64bsd_dr_set): Likewise.
(amd64bsd_dr_set_control): Likewise.
(amd64bsd_dr_set_addr): Likewise.
(amd64bsd_dr_get_addr): Likewise.
(amd64bsd_dr_get_status): Likewise.
(amd64bsd_dr_get_control): Likewise.
* amd64fbsd-nat.c: Include 'x86bsd-nat.h' instead of
'amd64bsd-nat.h'.
(super_mourn_inferior): Move to x86bsd-nat.c.
(amd64fbsd_mourn_inferior): Rename and move to x86bsd-nat.c.
(amd64fbsd_read_description): Replace 'amd64bsd_xsave_len' with
'x86bsd_xsave_len'.
(_initialize_amd64fbsd_nat): Remove x86 watchpoint setup and
mourn_inferior' target op.
* config/i386/fbsd.mh (NATDEPFILES): Add x86bsd-nat.o.
* config/i386/fbsd64.mh: Likewise.
* config/i386/nbsd64.mh: Likewise.
* config/i386/nbsdelf.mh: Likewise.
* config/i386/obsd.mh: Likewise.
* config/i386/obsd64.mh: Likewise.
* i386bsd-nat.c: Include 'x86bsd-nat.h'.
(i386bsd_xsave_len): Rename and move to x86bsd-nat.c.
(i386bsd_fetch_inferior_registers): Replace 'i386bsd_xsave_len'
with 'x86bsd_xsave_len'.
(i386bsd_store_inferior_registers): Likewise.
(i386bsd_target): Inherit from x86bsd_target.
(i386bsd_dr_get): Rename and move to x86bsd-nat.c.
(i386bsd_dr_set): Likewise.
(i386bsd_dr_set_control): Likewise.
(i386bsd_dr_set_addr): Likewise.
(i386bsd_dr_get_addr): Likewise.
(i386bsd_dr_get_status): Likewise.
(i386bsd_dr_get_control): Likewise.
* i386bsd-nat.h (i386bsd_xsave_len): Remove.
(i386bsd_dr_set_control): Remove.
(i386bsd_dr_set_addr): Remove.
(i386bsd_dr_get_addr): Remove.
(i386bsd_dr_get_status): Remove.
(i386bsd_dr_get_control): Remove.
* i386fbsd-nat.c: Include 'x86bsd-nat.h'.
(i386fbsd_read_description): Replace 'i386bsd_xsave_len' with
'x86bsd_xsave_len'.
(_initialize_i386fbsd_nat): Remove x86 watchpoint setup and
mourn_inferior' target op.
* x86bsd-nat.c: New file.
* x86bsd-nat.h: New file.
A relatively recent patch support for explicit locations, and part
of that patch cleaned up the way we parse breakpoint locations.
Unfortunatly, a small regression crept in for "*<EXPR>" breakpoint
locations. In particular, on PIE programs, one can see the issue by
doing the following, with any program:
(gdb) b *main
Breakpoint 1 at 0x51a: file hello.c, line 3.
(gdb) run
Starting program: /[...]/hello
Error in re-setting breakpoint 1: Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x51a
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x51a
Just for the record, this regression was introduced by:
commit a06efdd6ef
Date: Tue Aug 11 17:09:35 2015 -0700
Subject: Explicit locations: introduce address locations
What happens is that the patch makes the implicit assumption that
the address computed the first time is static, as if it was designed
to only support litteral expressions (Eg. "*0x1234"). This allows
the shortcut of not re-computing the breakpoint location's address
when re-setting breakpoints.
However, this does not work in general, as demonstrated in the example
above.
This patch plugs that hole simply by saving the original expression
used to compute the address as part of the address location, so as
to then re-evaluate that expression during breakpoint re-set.
gdb/ChangeLog:
* location.h (new_address_location): Add new parameters
"addr_string" and "addr_string_len".
(get_address_string_location): Add declaration.
* location.c (new_address_location): Add new parameters
"addr_string" and "addr_string_len". If not NULL, store
a copy of the addr_string in the new location as well.
(get_address_string_location): New function.
(string_to_event_location): Update call to new_address_location.
* linespec.c (event_location_to_sals) <ADDRESS_LOCATION>:
Save the event location in the parser's state before
passing it to convert_address_location_to_sals.
* breakpoint.c (create_thread_event_breakpoint): Update call
to new_address_location.
(init_breakpoint_sal): Get the event location's string, if any,
and use it to update call to new_address_location.
* python/py-finishbreakpoint.c (bpfinishpy_init):
Update call to new_address_location.
* spu-tdep.c (spu_catch_start): Likewise.
* config/djgpp/fnchange.lst: Add entries for
gdb/testsuite/gdb.base/break-fun-addr1.c and
gdb/testsuite/gdb.base/break-fun-addr2.c.
gdb/testsuite/ChangeLog:
* gdb.base/break-fun-addr.exp: New file.
* gdb.base/break-fun-addr1.c: New file.
* gdb.base/break-fun-addr2.c: New file.
Per GDB the "Start of New Year Procedure", this patch
- renames the current ChangeLog into ChangeLog-2015;
- starts a new ChangeLog file.
gdb/ChangeLog:
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2015.
When I look at test fails related to watchpoint on aarch64-linux,
I find there are some code duplicates between GDB and GDBserver.
This patch is to move some of them to a nat/aarch64-linux-hw-point.{h,c}.
The only change I do is about the dr_changed_t typedef, which was
ULONGEST in GDB and 'unsigned long long' in GDBserver. Each bit
of dr_changed_t represents a status of each HW breakpoint or
watchpoint register, and the max number of HW breakpoint or watchpoint
registers is 16, so the width of 'unsigned long long' is sufficient.
gdb:
2015-07-17 Yao Qi <yao.qi@linaro.org>
* Makefile.in (HFILES_NO_SRCDIR): Add
nat/aarch64-linux-hw-point.h.
(aarch64-linux-hw-point.o): New rule.
* nat/aarch64-linux-hw-point.h: New file.
* nat/aarch64-linux-hw-point.c: New file.
* aarch64-linux-nat.c: Include nat/aarch64-linux-hw-point.h.
(AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
(AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
(AARCH64_HWP_ALIGNMENT): Likewise.
(AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
(AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
(AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
(DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
(DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
(aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
(struct aarch64_debug_reg_state): Likewise.
(struct arch_lwp_info): Likewise.
(aarch64_linux_set_debug_regs): Likewise.
(aarch64_notify_debug_reg_change): Remove static.
(aarch64_align_watchpoint): Likewise.
(DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
(aarch64_watchpoint_length): Likewise.
(aarch64_point_encode_ctrl_reg): Likewise
(aarch64_point_is_aligned): Likewise.
(aarch64_dr_state_insert_one_point): Likewise.
(aarch64_dr_state_remove_one_point): Likewise.
(aarch64_handle_breakpoint): Likewise.
(aarch64_handle_aligned_watchpoint): Likewise.
(aarch64_handle_unaligned_watchpoint): Likewise.
(aarch64_handle_watchpoint): Likewise.
* config/aarch64/linux.mh (NAT_FILE): Add
aarch64-linux-hw-point.o.
gdb/gdbserver:
2015-07-17 Yao Qi <yao.qi@linaro.org>
* Makefile.in (aarch64-linux-hw-point.o): New rule.
* configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
* linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
(AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
(AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
(AARCH64_HWP_ALIGNMENT): Likewise.
(AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
(AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
(aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
(AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
(DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
(DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
(struct aarch64_debug_reg_state): Likewise.
(struct arch_lwp_info): Likewise.
(aarch64_align_watchpoint): Likewise.
(DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
(aarch64_watchpoint_length): Likewise.
(aarch64_point_encode_ctrl_reg): Likewise
(aarch64_point_is_aligned): Likewise.
(aarch64_align_watchpoint): Likewise.
(aarch64_linux_set_debug_regs):
(aarch64_dr_state_insert_one_point): Likewise.
(aarch64_dr_state_remove_one_point): Likewise.
(aarch64_handle_breakpoint): Likewise.
(aarch64_handle_aligned_watchpoint): Likewise.
(aarch64_handle_unaligned_watchpoint): Likewise.
(aarch64_handle_watchpoint): Likewise.
This patch is to let aarch64 GDB debug 32-bit arm program natively. In
each function for fetching and storing registers, GDB will check
gdbarch_bfd_arch_info (gdbarch)->bits_per_word, if it is 32, call
the corresponding aarch32 functions in aarch32-linux-nat.c, otherwise
fall back to aarch64 code to fetch and store registers.
aarch64_linux_read_description has to return the right target description,
but we don't have gdbarch available there, so GDB fetches auxv and gets
AT_PHENT, in order to determine whether the target is 32-bit or 64-bit.
I learned this trick from solib-svr4.c.
gdb:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* aarch32-linux-nat.h (VFP_REGS_SIZE): New macro, moved from
arm-linux-nat.c.
* aarch64-linux-nat.c: Include aarch32-linux-nat.h and
elf/external.h.
(fetch_gregs_from_thread): Call aarch32_gp_regcache_supply
if target is 32-bit.
(store_gregs_to_thread): Call aarch32_gp_regcache_collect
if target is 32-bit.
(fetch_fpregs_from_thread): Call aarch32_vfp_regcache_supply
if target is 32-bit.
(store_fpregs_to_thread): Call aarch32_vfp_regcache_collect
if target is 32-bit.
(tdesc_arm_with_vfpv3, tdesc_arm_with_neon): Declare.
(aarch64_linux_read_description): Return the right target
description.
* arm-linux-nat.c (VFP_REGS_SIZE): Moved to aarch32-linux-nat.h.
* config/aarch64/linux.mh (NATDEPFILES): Add aarch32-linux-nat.o.
* configure.tgt (aarch64*-*-linux*): Add arm-tdep.o and
arm-linux-tdep.o
This patch is to move all the code about transferring
regcache <-> byte buffer for arm (aarch32) to a separate file
aarch32-linux-nat.c. Then, in the following patch, aarch64 code
can use it to do multi-arch debugging. This is a refactory patch.
gdb:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* aarch32-linux-nat.c: New file.
* aarch32-linux-nat.h: New file.
* arm-linux-nat.c: Include aarch32-linux-nat.h.
(fetch_regs): Move code to aarch32-linux-nat.c. Call
aarch32_gp_regcache_supply.
(store_regs): Move code to aarch32-linux-nat.c. Call
aarch32_gp_regcache_collect.
(fetch_vfp_regs): Move code to aarch32-linux-nat.c. Call
aarch32_vfp_regcache_supply.
(store_vfp_regs): Move code to aarch32-linux-nat.c. Call
aarch32_vfp_regcache_collect.
* config/arm/linux.mh (NATDEPFILES): Add aarch32-linux-nat.o.
This commit moves the code to handle lwp_info.arch_private for
Linux x86 into a new shared file, nat/x86-linux.c.
gdb/ChangeLog:
* nat/x86-linux.h: New file.
* nat/x86-linux.c: Likewise.
* Makefile.in (HFILES_NO_SRCDIR): Add nat/x86-linux.h.
(x86-linux.o): New rule.
* config/i386/linux.mh (NATDEPFILES): Add x86-linux.o.
* config/i386/linux64.mh (NATDEPFILES): Likewise.
* nat/linux-nat.h (struct arch_lwp_info): New forward declaration.
(lwp_set_arch_private_info): New declaration.
(lwp_arch_private_info): Likewise.
* linux-nat.c (lwp_set_arch_private_info): New function.
(lwp_arch_private_info): Likewise.
* x86-linux-nat.c: Include nat/x86-linux.h.
(arch_lwp_info): Removed structure.
(update_debug_registers_callback):
Use lwp_set_debug_registers_changed.
(x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
and lwp_set_debug_registers_changed.
(x86_linux_new_thread): Use lwp_set_debug_registers_changed.
gdb/gdbserver/ChangeLog:
* Makefile.in (x86-linux.o): New rule.
* configure.srv: Add x86-linux.o to relevant targets.
* linux-low.c (lwp_set_arch_private_info): New function.
(lwp_arch_private_info): Likewise.
* linux-x86-low.c: Include nat/x86-linux.h.
(arch_lwp_info): Removed structure.
(update_debug_registers_callback):
Use lwp_set_debug_registers_changed.
(x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
and lwp_set_debug_registers_changed.
(x86_linux_new_thread): Use lwp_set_debug_registers_changed.
IIUC it is a pre-requisite for IPv6 support, some UNICes do not support
getaddrinfo required for IPv6. But coincidentally such UNICes are no longer
really supported by GDB. Therefore it was concluded we can remove all such
UNICes and then we can implement IPv6 easily with getaddrinfo.
In mail
Re: getaddrinfo available on all GDB hosts? [Re: [PATCH v2] Add IPv6 support for remote TCP connections]
Message-ID: <20140211034157.GG5485@adacore.com>
https://sourceware.org/ml/gdb-patches/2014-02/msg00333.html
Joel said:
So I chose HP-UX first for this patch.
gdb/ChangeLog
2014-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Remove HPUX.
* Makefile.in (ALL_64_TARGET_OBS): Remove ia64-hpux-tdep.o.
(ALL_TARGET_OBS): Remove hppa-hpux-tdep.o, solib-som.o and solib-pa64.o.
(HFILES_NO_SRCDIR): Remove solib-som.h, inf-ttrace.h, solib-pa64.h and
ia64-hpux-tdep.h, solib-ia64-hpux.h.
(ALLDEPFILES): Remove hppa-hpux-tdep.c, hppa-hpux-nat.c,
ia64-hpux-nat.c, ia64-hpux-tdep.c, somread.c and solib-som.c.
* config/djgpp/fnchange.lst: Remove hppa-hpux-nat.c and
hppa-hpux-tdep.c.
* config/ia64/hpux.mh: Remove file.
* config/pa/hpux.mh: Remove file.
* configure: Rebuilt.
* configure.ac (dlgetmodinfo, somread.o): Remove.
* configure.host (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete.
(ia64-*-hpux*): Remove its float format exception.
* configure.tgt (hppa*-*-hpux*, ia64-*-hpux*): Make them obsolete.
* hppa-hpux-nat.c: Remove file.
* hppa-hpux-tdep.c: Remove file.
* hppa-tdep.c (struct hppa_unwind_info, struct hppa_objfile_private):
Move them here from hppa-tdep.h
(hppa_objfile_priv_data, hppa_init_objfile_priv_data): Make it static.
(hppa_frame_prev_register_helper): Remove HPPA_FLAGS_REGNUM exception.
* hppa-tdep.h (struct hppa_unwind_info, struct hppa_objfile_private):
Move them to hppa-tdep.c.
(hppa_objfile_priv_data, hppa_init_objfile_priv_data): Remove
declarations.
* ia64-hpux-nat.c: Remove file.
* ia64-hpux-tdep.c: Remove file.
* ia64-hpux-tdep.h: Remove file.
* inf-ttrace.c: Remove file.
* inf-ttrace.h: Remove file.
* solib-ia64-hpux.c: Remove file.
* solib-ia64-hpux.h: Remove file.
* solib-pa64.c: Remove file.
* solib-pa64.h: Remove file.
* solib-som.c: Remove file.
* solib-som.h: Remove file.
* somread.c: Remove file.
This patch moves the shared code present on
gdb/linux-nat.c:linux_nat_create_inferior and
gdb/gdbserver/linux-low.c:linux_create_inferior to
nat/linux-personality.c. This code is responsible for disabling
address space randomization based on user setting, and using
<sys/personality.h> to do that. I decided to put the prototype of the
maybe_disable_address_space_randomization on nat/linux-osdata.h
because it seemed the best place to put it.
I regression-tested this patch on Fedora 20 x86_64, and found no
regressions.
gdb/ChangeLog
2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-personality.h.
(linux-personality.o): New rule.
* common/common-defs.h: Include <stdint.h>.
* config/aarch64/linux.mh (NATDEPFILES): Include
linux-personality.o.
* config/alpha/alpha-linux.mh (NATDEPFILES): Likewise.
* config/arm/linux.mh (NATDEPFILES): Likewise.
* config/i386/linux64.mh (NATDEPFILES): Likewise.
* config/i386/linux.mh (NATDEPFILES): Likewise.
* config/ia64/linux.mh (NATDEPFILES): Likewise.
* config/m32r/linux.mh (NATDEPFILES): Likewise.
* config/m68k/linux.mh (NATDEPFILES): Likewise.
* config/mips/linux.mh (NATDEPFILES): Likewise.
* config/pa/linux.mh (NATDEPFILES): Likewise.
* config/powerpc/linux.mh (NATDEPFILES): Likewise.
* config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise.
* config/powerpc/spu-linux.mh (NATDEPFILES): Likewise.
* config/s390/linux.mh (NATDEPFILES): Likewise.
* config/sparc/linux64.mh (NATDEPFILES): Likewise.
* config/sparc/linux.mh (NATDEPFILES): Likewise.
* config/tilegx/linux.mh (NATDEPFILES): Likewise.
* config/xtensa/linux.mh (NATDEPFILES): Likewise.
* defs.h: Remove #include <stdint.h> (moved to
common/common-defs.h).
* linux-nat.c: Include nat/linux-personality.h. Remove #include
<sys/personality.h>; do not define ADDR_NO_RANDOMIZE (moved to
nat/linux-personality.c).
(linux_nat_create_inferior): Remove code to disable address space
randomization (moved to nat/linux-personality.c). Create cleanup
to disable address space randomization.
* nat/linux-personality.c: New file.
* nat/linux-personality.h: Likewise.
gdb/gdbserver/ChangeLog
2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com>
* Makefile.in (SFILES): Add linux-personality.c.
(linux-personality.o): New rule.
* configure.srv (srv_linux_obj): Add linux-personality.o to the
list of objects to be built.
* linux-low.c: Include nat/linux-personality.h.
(linux_create_inferior): Remove code to disable address space
randomization (moved to ../nat/linux-personality.c). Create
cleanup to disable address space randomization.
This patch is to teach both GDB and GDBServer to detect 64-bit inferior
correctly. We find a problem that GDBServer is unable to detect on a
e5500 core processor. Current GDBServer assumes that MSR is a 64-bit
register, but MSR is a 32-bit register in Book III-E. This patch is
to fix this problem by checking the right bit in MSR, in order to handle
both Book III-S and Book III-E. In order to detect Book III-S and
Book III-E, we check the PPC_FEATURE_BOOKE from the host's HWCAP (by
getauxval on glibc >= 2.16. If getauxval doesn't exist, we implement
the fallback by parsing /proc/self/auxv), because it should an invariant
on the same machine cross different processes.
In order to share code, I add nat/ppc-linux.c for both GDB and
GDBserver side.
gdb:
2015-01-14 Yao Qi <yao@codesourcery.com>
* Makefile.in (ppc-linux.o): New rule.
* config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o.
* configure.ac: AC_CHECK_FUNCS(getauxval).
* config.in: Re-generated.
* configure: Re-generated.
* nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p):
Declare.
* nat/ppc-linux.c: New file.
* ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]:
Call ppc64_64bit_inferior_p.
gdb/gdbserver:
2015-01-14 Yao Qi <yao@codesourcery.com>
* Makefile.in (SFILES): Add nat/ppc-linux.c.
(ppc-linux.o): New rule.
* configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
* configure.ac: AC_CHECK_FUNCS(getauxval).
* config.in: Re-generated.
* configure: Re-generated.
* linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
ppc64_64bit_inferior_p
This patch renames gdb/'s ChangeLog to ChangeLog-2014 and creates
a new one for 2015. config/djgpp/fnchange.lst is updated accordingly.
gdb/ChangeLog:
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2014.
Remove native-only core file handling on Sparc Solaris. Instead,
enable the sparc target generic core regset logic on Solaris by
providing appropriate register offset maps.
Thanks to Joel Brobecker for testing!
gdb/
* config/sparc/sol2.mh (NATDEPFILES): Remove core-regset.o.
* sparc-sol2-tdep.c: Include "regset.h".
(sparc32_sol2_supply_core_gregset): New function.
(sparc32_sol2_collect_core_gregset): Likewise.
(sparc32_sol2_supply_core_fpregset): Likewise.
(sparc32_sol2_collect_core_fpregset): Likewise.
(sparc32_sol2_gregset, sparc32_sol2_fpregset): New variables.
(sparc32_sol2_init_abi): Set tdep->gregset/sizeof_gregset and
tdep->fpregset/sizeof_fpregset.
* sparc64-sol2-tdep.c: Include "regset.h".
(sparc64_sol2_supply_core_gregset): New function.
(sparc64_sol2_collect_core_gregset): Likewise.
(sparc64_sol2_supply_core_fpregset): Likewise.
(sparc64_sol2_collect_core_fpregset): Likewise.
(sparc64_sol2_gregset, sparc64_sol2_fpregset): New variables.
(sparc64_sol2_init_abi): Set tdep->gregset/sizeof_gregset and
tdep->fpregset/sizeof_fpregset.
Remove native-only core file handling on GNU Hurd. Instead, enable the
x86 target generic core regset logic on the Hurd by providing an
appropriate register offset map.
Thanks to Samuel Thibault for testing!
gdb/
* config/i386/i386gnu.mh (NATDEPFILES): Remove core-regset.o.
* i386gnu-nat.c: Do not include <sys/procfs.h> or "gregset.h".
(CREG_OFFSET, creg_offset, CREG_ADDR): Remove.
(supply_gregset, supply_fpregset): Remove.
* i386gnu-tdep.c (i386gnu_gregset_reg_offset): New variable.
(i386gnu_init_abi): Set tdep->gregset_reg_offset, gregset_num_regs,
and sizeof_gregset.
Since Andreas Arnez' recent patch series, all Linux targets install
gdbarch_iterate_over_regset_sections routines. This means that on
Linux native targets, old-style core sniffers are never used.
Most Linux targets haven't been using such sniffers for a long time
anyway, but a couple remain: ia64 and sparc use core-regset.o, and
m68k installs its own core_fns. All this is now dead code, which
this commit removes.
gdb/
2014-11-28 Ulrich Weigand <uweigand@de.ibm.com>
* config/ia64/linux.mh (NATDEPFILES): Remove core-regset.o.
* config/sparc/linux.mh (NATDEPFILES): Likewise.
* config/sparc/linux64.mh (NATDEPFILES): Likewise.
* m68klinux-nat.c (fetch_core_registers): Remove.
(linux_elf_core_fns): Remove.
(_initialize_m68k_linux_nat): Do not call deprecated_add_core_fns.
I cross-compile gdb for msdosdjgpp (both target and host is
i586-pc-msdosdjgpp), so the CC should be i586-pc-msdosdjgpp-gcc.
However, CC is set incorrectly to gcc after config/i386/go32.mh is inlined
into the Makefile.
This patch is to remove the CC setting in config/i386/go32.mh.
gdb:
2014-11-19 Yao Qi <yao@codesourcery.com>
* config/i386/go32.mh (CC): Remove.
This commit does most of the mechanical removal. IOW, the easy part.
procfs.c isn't touched beyond removing a couple obvious bits that are
guarded by a couple macros defined in config/alpha/nm-osf3.h. Going
beyond that for procfs.c & co would be a harder excision that
potentially affects Solaris.
Some comments in the generic alpha code ABIs that may still be
relevant and I wouldn't know what to do with them. That can always be
done on a separate pass, preferably by someone who can test on alpha.
A couple other spots have references to OSF/Tru64 and related files
being removed, but it felt like removing them would make things worse,
not better. We can revisit those when we next need to touch that
code.
I didn't remove a reference to osf in testsuite/lib/future.exp, as I
believe that code is imported from DejaGNU.
Built and tested on x86_64 Fedora 20, with --enable-targets=all.
Tested that building for --target=alpha-osf3 on x86_64 Fedora 20
fails with:
checking for default auto-load directory... $debugdir:$datadir/auto-load
checking for default auto-load safe-path... $debugdir:$datadir/auto-load
*** Configuration alpha-unknown-osf3 is obsolete.
*** Support has been REMOVED.
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `build-osf'
make: *** [all] Error 2
gdb/
2014-10-17 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_64_TARGET_OBS): Remove alpha-osf1-tdep.o.
(HFILES_NO_SRCDIR): Remove config/alpha/nm-osf3.h.
(ALLDEPFILES): Remove alpha-nat.c, alpha-osf1-tdep.c and
solib-osf.c.
* NEWS: Mention that support for alpha*-*-osf* has been removed.
* ada-lang.h [__alpha__ && __osf__]
(ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS): Delete.
* alpha-nat.c, alpha-osf1-tdep.c: Delete files.
* alpha-tdep.c (alpha_gdbarch_init): Remove reference to
GDB_OSABI_OSF1.
* config/alpha/alpha-osf3.mh, config/alpha/nm-osf3.h: Delete
files.
* config/djgpp/fnchange.lst (config/alpha/alpha-osf1.mh)
(config/alpha/alpha-osf2.mh, config/alpha/alpha-osf3.mh): Delete.
* configure: Regenerate.
* configure.ac: Remove references to osf.
* configure.host: Handle alpha*-*-osf* in the obsolete hosts
section. Remove all other references to osf.
* configure.tgt: Add alpha*-*-osf* to the obsolete targets section.
Remove all other references to osf.
* dec-thread.c: Delete file.
* defs.h (GDB_OSABI_OSF1): Delete.
* inferior.h (START_INFERIOR_TRAPS_EXPECTED): New unconditionally
defined.
* osabi.c (gdb_osabi_names): Delete "OSF/1".
* procfs.c (procfs_debug_inferior) [PROCFS_DONT_TRACE_FAULTS]:
Delete code.
(unconditionally_kill_inferior)
[PROCFS_NEED_CLEAR_CURSIG_FOR_KILL]: Delete code.
* solib-osf.c: Delete file.
gdb/testsuite/
2014-10-17 Pedro Alves <palves@redhat.com>
* gdb.base/callfuncs.exp: emove references to osf.
* gdb.base/sigall.exp: Likewise.
* gdb.gdb/selftest.exp: Likewise.
* gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
* gdb.mi/non-stop.c: Likewise.
* gdb.mi/pthreads.c: Likewise.
* gdb.reverse/sigall-precsave.exp: Likewise.
* gdb.reverse/sigall-reverse.exp: Likewise.
* gdb.threads/pthreads.c: Likewise.
* gdb.threads/pthreads.exp: Likewise.
gdb/doc/
2014-10-17 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Ada Tasks and Core Files): Delete mention of Tru64.
(SVR4 Process Information): Delete mention of OSF/1.
This does most of the mechanical removal. IOW, the easy part.
This doesn't touch procfs.c as that'd be a harder excision,
potentially affecting Solaris.
mips-tdep.c is left alone. E.g., I didn't delete the GDB_OSABI_IRIX
enum value, nor references to it in mips-tdep.c. Some comments
mentioning IRIX ABIs may still be relevant and I wouldn't know what to
do with them. in That can always be done on a separate pass,
preferably by someone who can test on MIPS.
I didn't remove a reference to IRIX in testsuite/lib/future.exp, as I
believe that code is imported from DejaGNU.
Built and tested on x86_64 Fedora 20, with --enable-targets=all.
Tested that building for --target=mips-sgi-irix6 on x86_64 Fedora 20
fails with:
checking for default auto-load directory... $debugdir:$datadir/auto-load
checking for default auto-load safe-path... $debugdir:$datadir/auto-load
*** Configuration mips-sgi-irix6 is obsolete.
*** Support has been REMOVED.
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/home/pedro/gdb/mygit/build-irix'
make: *** [all] Error 2
gdb/
2014-10-10 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_TARGET_OBS): Remove mips-irix-tdep.o and solib-irix.o.
(ALLDEPFILES): Remove mips-irix-tdep.c and solib-irix.c.
(HFILES_NO_SRCDIR): Remove solib-irix.h.
* NEWS: Mention that support for mips-sgi-irix5* mips-sgi-irix6*
and been removed.
* config/mips/irix5.mh, config/mips/irix6.mh: Delete files.
* configure.ac: Remove references to IRIX.
* configure.host: Add *-*-irix* to the obsolete hosts section.
Remove all other references to irix.
* irix5-nat.c, mips-irix-tdep.c, solib-irix.c, solib-irix.h:
Delete files.
gdb/testsuite/
2014-10-10 Pedro Alves <palves@redhat.com>
* gdb.base/bigcore.exp: Remove references to IRIX.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/interrupt.exp: Likewise.
* gdb.base/mips_pro.exp: Likewise.
* gdb.base/nodebug.exp: Likewise.
* gdb.base/setvar.exp: Likewise.
* lib/gdb.exp (gdb_compile_shlib): Remove mips-sgi-irix* case.
This commit renames nine files that contain code used by both 32- and
64-bit Intel ports such that their names are prefixed with "x86"
rather than "i386". All types, functions and variables within these
files are likewise renamed such that their names are prefixed with
"x86" rather than "i386". This makes GDB follow the convention used
by gdbserver such that 32-bit Intel code lives in files called
"i386-*", 64-bit Intel code lives in files called "amd64-*", and code
for both 32- and 64-bit Intel lives in files called "x86-*".
This commit only renames OS-independent files. The Linux ports of
both GDB and gdbserver now follow the i386/amd64/x86 convention fully.
Some ports still use the old convention where "i386" in file/function/
type/variable names can mean "32-bit only" or "32- and 64-bit" but I
don't want to touch ports I can't fully test except where absolutely
necessary.
gdb/ChangeLog:
* i386-nat.h: Renamed as...
* x86-nat.h: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
* i386-nat.c: Renamed as...
* x86-nat.c: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
* common/i386-xstate.h: Renamed as...
* common/x86-xstate.h: New file. All type, function and variable
name prefixes changed from "i386_" to "x86_". All references
updated.
* nat/i386-cpuid.h: Renamed as...
* nat/x86-cpuid.h: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
* nat/i386-gcc-cpuid.h: Renamed as...
* nat/x86-gcc-cpuid.h: New file. All type, function and variable
name prefixes changed from "i386_" to "x86_". All references
updated.
* nat/i386-dregs.h: Renamed as...
* nat/x86-dregs.h: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
* nat/i386-dregs.c: Renamed as...
* nat/x86-dregs.c: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
gdb/gdbserver/ChangeLog:
* i386-low.h: Renamed as...
* x86-low.h: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
* i386-low.c: Renamed as...
* x86-low.c: New file. All type, function and variable name
prefixes changed from "i386_" to "x86_". All references updated.
As suggested before, rename the S/390-related source files (tdep and nat)
such that "-linux-" occurs in the file name, like with other GNU/Linux
targets. Since no other operating system is currently supported by GDB
on this architecture, this isn't strictly necessary. But the old names
sometimes caused GDB contributors to miss these files when performing a
change that affects all GNU/Linux targets. The latest such incident was
observed here:
https://sourceware.org/ml/gdb-patches/2013-09/msg00619.html
gdb/
2013-10-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
* s390-tdep.h: Rename to...
* s390-linux-tdep.h: ...here.
* s390-tdep.c: Rename to...
* s390-linux-tdep.c: ...here. Adjust #include.
* s390-nat.c: Rename to...
* s390-linux-nat.c: ...here. Adjust #include.
* config/s390/s390.mh: Rename to...
* config/s390/linux.mh: ...here. Reflect rename s390-nat.o ->
s390-linux-nat.o.
* configure.host: Reflect host rename "s390" -> "linux".
* configure.tgt: Reflect rename s390-tdep.o -> s390-linux-tdep.o.
* Makefile.in (ALL_TARGET_OBS): Likewise.
(HFILES_NO_SRCDIR): Reflect rename s390-tdep.h ->
s390-linux-tdep.h.
(ALLDEPFILES): Reflect rename of .c files.
Occasionaly we hear about people having problems with GDB not being
able to start programs (with "run"/"start"). GDB spawns a shell to
start the program, and most often, it'll be the case that the problem
is actually with the user's shell setup.
GDB has code to disable the use of the shell to start programs.
That's the STARTUP_WITH_SHELL macro that native targets could set to 0
in their nm.h file (though no target actually uses it nowadays).
This patch makes that setting a run-time knob instead. This will be
useful to quickly diagnose such shell issues, and might also come in
handy at other times (such as when debugging the shell itself, if you
don't have a different shell handy).
gdb/
2013-10-24 Pedro Alves <palves@redhat.com>
* NEWS (New options): Mention set/show startup-with-shell.
* config/alpha/nm-osf3.h (START_INFERIOR_TRAPS_EXPECTED): Set to 2
instead of 3.
* fork-child.c (fork_inferior, startup_inferior): Handle 'set
startup-with-shell'.
(show_startup_with_shell): New function.
(_initialize_fork_child): Register the set/show startup-with-shell
commands.
* inf-ptrace.c (inf_ptrace_create_inferior): Remove comment.
* inf-ttrace.c (inf_ttrace_him): Remove comment.
* procfs.c (procfs_init_inferior): Remove comment.
* infcmd.c (startup_with_shell): New global.
* inferior.h (startup_with_shell): Declare global.
(STARTUP_WITH_SHELL): Delete.
(START_INFERIOR_TRAPS_EXPECTED): Set to 1 by default instead of 2.
gdb/doc/
2013-10-24 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Starting): Document set/show startup-with-shell.