• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/arnez/lk3
RSS
Rev. Time Author
3626824 users/arnez/lk3 2017-03-17 01:01:49 Philipp Rudo

Add S390 support for linux-kernel target

After implementing the new linux-kernel target and preparing s390-tdep.
It is now time to get everything to work. Thus implement the hooks
required by the linux-kernel target and enable s390's privileged
registers.

gdb/ChangeLog:

* s390-lk-tdep.h: New file.
* s390-lk-tdep.c: New file.
* Makefile.in (ALL_TARGET_OBS): Add s390-lk-tdep.o.
(HFILES_NO_SRCDIR): Add s390-lk-tdep.h.
(ALLDEPFILES): Add s390-lk-tdep.c.
* configure.tgt (s390*-*-linux*): Add s390-lk-tdep.o.
* s390-tdep.h: Define macros for address translation.
* s390-tdep.c (s390-lk-tdep.h): New include.
(s390_iterate_over_regset_sections): Enable privileged registers.
(s390_core_read_description): Enable privileged registers.
(s390_gdbarch_init): : Enable privileged registers and adjust.

d67d2e9 2017-03-17 01:01:49 Philipp Rudo

Add privileged registers for s390x

The Linux kernel and thus the linux-kernel target needs access to S390x's
privileged registers. Define new features and prepare s390-tdep.* to use
them in new Linux kernel code.

gdb/ChangeLog:

* features/s390-cr.xml: New file.
* features/s390x-cr-linux64.xml: New file
* features/s390x-vxcr-linux64.xml: New file
* features/Makefile: Add s390x-cr-linux64-expedite and
s390x-vxcr-linux64-expedite
(WICH): Add s390x-cr-linux64.xml and s390x-vxcr-linux64.xml
(XMLTOC): Add s390x-cr-linux64.xml and s390x-vxcr-linux64.xml
* features/s390x-cr-linux64.c: Generated.
* features/s390x-vxcr-linux64.c: Generated.
* regformats/s390x-cr-linux64.dat: Generated.
* regformats/s390x-vxcr-linux64.dat: Generated.
* s390-tdep.h: Define regnums for control registers.
(S390_NUM_REGS): Adjust.
* s390-tdep.c: (s390_dwarf_regmat): Add control registers.

8539bfc 2017-03-17 01:01:49 Philipp Rudo

Seperate common s390-tdep.* from s390-linux-tdep.*

The new linux-kernel target need some architecture dependant code. To
prepare for this split up the existing s390 code into a general s390-tedep
and a GDNU/Linux (user space) specific s390-linux-tdep. This keeps the
files manageable and allows for kernel specific code e.g. unwinder.

gdb/ChangeLog:

* s390-tdep.h: New file.
* s390-tdep.c: New file.
* Makefile.in (ALL_TARGET_OBS): Add s390-tdep.o.
(HFILES_NO_SRCDIR): Add s390-tdep.h.
(ALLDEPFILES): Add s390-tdep.c.
* configure.tgt (s390*-*-linux*): Add s390-tdep.o.
* s390-linux-tdep.h: Move defines for hardware capabilities and
register informations to s390-tdep.h.
(s390_gdbarch_linux_init): New export.
(s390_upper_registers): New export.
* s390-linux-tdep.c: Remove unneeded includes and sort alphabetically.
(s390-tdep.h): New include.
(s390_upper_regset): Remove static.
(s390_gdbarch_init): Rename to...
(s390_gdbarch_linux_init): ...this and adjust.
(_initialize_s390_tdep): Rename to...
(_initialize_s390_linux_tdep): ...this and adjust.
(s390_abi_kind, s390_vector_abi_kind): Move to s390-tdep.h
(gdbarch_tdep, enum named opcodes): Move to s390-tdep.h
(s390_readinstruction, is_ri, is_ril): Move to s390-tdep.c
(is_rr, is_rre, is_rs, is_rsy, is_rsi, is_rie): Move to s390-tdep.c
(is_rx, is_rxy, s390_break_insn): Move to s390-tdep.c
(s390_breakpoint, s390_is_partial_instruction): Move to s390-tdep.c
(s390_software_single_step, s390_prologue_data): Move to s390-tdep.c
(s390_addr, s390_store, s390_load): Move to s390-tdep.c
(s390_check_for_saved, s390_analyze_prologue): Move to s390-tdep.c
(s390_skip_prologue, s390_register_call_saved): Move to s390-tdep.c
(s390_register_name, s390_cannot_store_register): Move to s390-tdep.c
(s390_write_pc, s390_dwarf_regmap): Move to s390-tdep.c
(s390_dwarf_reg_to_regnum, regnum_is_gpr_full): Move to s390-tdep.c
(regnum_is_vxr_full, s390_value_from_register): Move to s390-tdep.c
(s390_core_read_description): Move to s390-tdep.c
(s390_iterate_over_regset_sections): Move to s390-tdep.c
(s390_pseudo_register_name): Move to s390-tdep.c
(s390_pseudo_register_read): Move to s390-tdep.c
(s390_pseudo_register_write): Move to s390-tdep.c
(s390_pseudo_register_type): Move to s390-tdep.c
(s390_pseudo_register_reggroup_p): Move to s390-tdep.c
(s390_ax_pseudo_register_collect): Move to s390-tdep.c
(s390_ax_pseudo_register_push_stack): Move to s390-tdep.c
(s390_gen_return_address): Move to s390-tdep.c
(s390_unwind_pseudo_register): Move to s390-tdep.c
(s390_effective_inner_type): Move to s390-tdep.c
(s390_function_arg_float): Move to s390-tdep.c
(s390_function_arg_vector, is_power_of_two): Move to s390-tdep.c
(s390_function_arg_integer, s390_arg_state): Move to s390-tdep.c
(s390_handle_arg, s390_push_dummy_call): Move to s390-tdep.c
(s390_dummy_id, s390_register_return_value): Move to s390-tdep.c
(s390_return_value, s390_stack_frame_destroyed_p): Move to s390-tdep.c
(s390_dwarf2_prev_register): Move to s390-tdep.c
(s390_dwarf2_frame_init_reg): Move to s390-tdep.c
(s390_adjust_frame_regnum, s390_unwind_cache): Move to s390-tdep.c
(s390_prologue_frame_unwind_cache): Move to s390-tdep.c
(s390_stub_unwind_cache): Move to s390-tdep.c
(s390_stub_frame_unwind_cache): Move to s390-tdep.c
(s390_stub_frame_this_id): Move to s390-tdep.c
(s390_trad_frame_prev_register): Move to s390-tdep.c
(s390_stub_frame_prev_register): Move to s390-tdep.c
(s390_stub_frame_sniffer, s390_stub_frame_unwind): Move to s390-tdep.c
(s390_sigtramp_unwind_cache): Move to s390-tdep.c
(s390_sigtramp_frame_unwind_cache): Move to s390-tdep.c
(s390_sigtramp_frame_this_id): Move to s390-tdep.c
(s390_sigtramp_frame_prev_register): Move to s390-tdep.c
(s390_sigtramp_frame_sniffer): Move to s390-tdep.c
(s390_sigtramp_frame_unwind): Move to s390-tdep.c
(s390_backchain_frame_unwind_cache): Move to s390-tdep.c
(s390_frame_unwind_cache, s390_frame_this_id): Move to s390-tdep.c
(s390_frame_prev_register, s390_frame_unwind): Move to s390-tdep.c
(s390_frame_base_address): Move to s390-tdep.c
(s390_local_base_address, s390_frame_base): Move to s390-tdep.c
(s390_unwind_pc, s390_unwind_sp): Move to s390-tdep.c
(is_non_branch_ril): Move to s390-tdep.c
(s390_displaced_step_copy_insn): Move to s390-tdep.c
(s390_displaced_step_fixup): Move to s390-tdep.c
(s390_displaced_step_hw_singlestep): Move to s390-tdep.c
(s390_addr_bits_remove): Move to s390-tdep.c
(s390_address_class_type_flags): Move to s390-tdep.c
(s390_address_class_type_flags_to_name): Move to s390-tdep.c
(s390_address_class_name_to_type_flags): Move to s390-tdep.c

1bb7379 2017-03-17 01:01:48 Philipp Rudo

Add commands for linux-kernel target

This patch implements a "lsmod", "struct" and, "offset" command to work with
the new linux-kernel target. The commands are a handy byproduct from
development and crude hacks. I don't expect them to be accepted in the
current state. Nevertheless there needs to be an discussion on how and
where (see gdb/python scrips in kernel sources) to implement them. So here
is the start for it.

gdb/Changelog:

* lk-cmds.h: New file.
* lk-cmds.c: New file.
* lk-low.c: Include lk-cmds.h.
(lk_try_push_target): Init commands.
* typeprint.c: Remove unnecessary forward declarations.
(whatis_exp): Remove static.
* typeprint.h (whatis_exp): New export.
* Makefile.in (SFILES, ALLDEPFILES): Add lk-cmds.c.
(HFILES_NO_SRCDIR): Add lk-cmds.h.
(ALL_TARGET_OBS): Add lk-cmds.o.
* configure.tgt (lk_target_obs): Add lk-cmds.o.

699e91f 2017-03-17 01:01:48 Philipp Rudo

Add kernel module support for linux-kernel target

This patch implements module support for the new linux-kernel target by
adding a target_so_ops. In addition this patch adds handling for kernel
virtual addresses. This is necessary because kernel modules, unlike
task_structs, live in kernel virtual address space. Thus addresses need
to be translated before they can be read from. We achieve this by adding
an implementation for the targets to_xfer_partial hook, which translates
the addresses before passing them down to the target beneath.

gdb/ChangeLog:

* lk-modules.h: New file.
* lk-modules.c: New file.
* lk-low.h (lk_hook_is_kvaddr, lk_hook_vtop)
(lk_hook_get_module_text_offset): New arch dependent hooks.
(sturct lk_private_hooks): Add new hooks.
(LK_MODULES_NAME_LEN, LK_UTS_NAME_LEN): New define.
* lk-low.c (lk-modules.h): New include.
(lk_kvtop, restore_current_target, lk_xfer_partial): New functions.
(lk_init_private_data): Declare needed debug symbols.
(lk_try_push_target): Assert for new hooks and set solib_ops.
(init_linux_kernel_ops): Add implementation for to_xfer_partial.
* solib.c (get_solib_search_path): New function.
* solib.h (get_solib_search_path): New export.
* Makefile.in (SFILES, ALLDEPFILES): Add lk-modules.c.
(HFILES_NO_SRCDIR): Add lk-modules.h.
(ALL_TARGET_OBS): Add lk-modules.o.
* configure.tgt (lk_target_obs): Add lk-modules.o.

60a2f03 2017-03-17 01:01:48 Philipp Rudo

Add basic Linux kernel support

This patch implements a basic target_ops for Linux kernel support. In
particular it models Linux tasks as GDB threads such that you are able to
change to a given thread, get backtraces, disassemble the current frame
etc..

Currently the target_ops is designed only to work with static targets, i.e.
dumps. Thus it lacks implementation for hooks like to_wait, to_resume or
to_store_registers. Furthermore the mapping between a CPU and the
task_struct of the running task is only be done once at initialization. See
cover letter for a detailed discussion.

Nevertheless i made some design decisions different to Peter [1] which are
worth discussing. Especially storing the private data in a htab (or
std::unordered_map if i had the time...) instead of global variables makes
the code much nicer and less memory consuming.

[1] https://sourceware.org/ml/gdb-patches/2016-12/msg00382.html

gdb/ChangeLog:

* gdbarch.sh (lk_init_private): New hook.
* gdbarch.h: Regenerated.
* gdbarch.c: Regenerated.
* lk-low.h: New file.
* lk-low.c: New file.
* lk-lists.h: New file.
* lk-lists.c: New file.
* Makefile.in (SFILES, ALLDEPFILES): Add lk-low.c and lk-lists.c.
(HFILES_NO_SRCDIR): Add lk-low.h and lk-lists.h.
(ALL_TARGET_OBS): Add lk-low.o and lk-lists.o.
* configure.tgt (lk_target_obs): New variable with object files for Linux
kernel support.
(s390*-*-linux*): Add lk_target_obs.

09e978d 2017-03-17 01:01:47 Philipp Rudo

Add libiberty/concat styled concat_path function

This commit adds concat_path function to concatenate an arbitrary number of
path elements. The function automatically adds an directory separator between
two elements as needed.

gdb/ChangeLog:

* common/common-utils.h (endswith): New function.
* utils.c (_concat_path, approx_path_length): New function.
* utils.h (_concat_path): New export.
(concat_path): New define.

ad0b0e5 2017-03-17 01:01:47 Philipp Rudo

Convert substitute_path_component to C++

Simplify the code of utils.c:substiute_path_component by converting it to C++.

gdb/ChangeLog:

* utils.c (substitute_path_component): Convert to C++.
* utils.h (substitute_path_componetn): Adjust declatation.
* auto-load.c (auto_load_expand_dir_vars): Adjust.

28f1c60 2017-03-17 00:02:15 Jiong Wang

[Patch] Fix variable type glitch in inf-ptrace.c

gdb/
* inf-ptrace.c (inf_ptrace_peek_poke): Change the type to "ULONGEST"
for "skip".

ec3b243 2017-03-16 23:02:31 Thomas Preud'homme

Fix expect for gdb.cp/m-static.exp

The expectation in gdb.cp/m-static.exp for the ptype of
single_constructor is to get in the result of destructor with the
following prototype: ~single_constructor(int).

Yet, m-static.cc declares the destructor as ~single_constructor(). This
commit fixes the expectation.

2017-03-16 Thomas Preud'homme <thomas.preudhomme@arm.com>

gdb/testsuite/
* gdb.cp/m-static.exp: Fix expectation for prototype of
test5.single_constructor and single_constructor::single_constructor.

2c52e2e 2017-03-16 19:07:22 Rinat Zelig

gas/arc: Limit special handling of t/nt flag to ARCv2

In a later commit I'll be adding a new version of the ".nt" flag for an
ARC700 extension (NPS400) which does not require this same special
handling.

In this commit I have restricted the special flag handling to only apply
if we are assembling for ARCv2. This is a restructuring commit, and
there should be no user visible changes after this commit.

gas/ChangeLog:

* config/tc-arc.c (assemble_insn): Only handle ".t" and ".nt"
specially for ARCv2.

e189bfe 2017-03-16 09:00:45 GDB Administrator

Automatic date update in version.in

aab2c17 2017-03-16 08:51:35 Vladimir Radosavljevic

Mips: Fix TLS LDM GOT entry.

gold/
* mips.cc (Mips_got_entry::hash()): Shift addend to reduce
possibility of collisions.
(Mips_got_entry::equals): Fix case for GOT_TLS_LDM
entries.

4d78db4 2017-03-16 08:51:35 Vladimir Radosavljevic

Mips: Omit empty objects for merging processor-specific data.

gold/
* mips.cc (Mips_relobj::merge_processor_specific_data_): New data
member.
(Mips_relobj::merge_processor_specific_data): New method.
(Mips_relobj::do_read_symbols): Set merge_processor_specific_data_
to false, only if the input file is a binary or if object has no
contents except the section name string table and an empty symbol
table with the undefined symbol.
(Target_mips::do_finalize_sections): Refactor. Skip empty object files
for merging processor-specific data.

152c92b 2017-03-16 08:51:35 Vladimir Radosavljevic

Mips: Add support for resolving multiple consecutive relocations.

gold/
* mips.cc (Target_mips::Relocate::calculated_value_): New data
member.
(Target_mips::Relocate::calculate_only_): Likewise.
(Target_mips::Relocate::relocate): Handle multiple consecutive
relocations with the same offset.

1e1247c 2017-03-16 08:51:35 Vladimir Radosavljevic

Remove redundant checks for relocatable link (MIPS).

gold/
* mips.cc (Target_mips::Relocate::relocate): Remove redundant
checks for relocatable link.
(Mips_relocate_functions::reljalr): Likewise.

1728969 2017-03-16 08:51:35 Vladimir Radosavljevic

Add support for .MIPS.options section.

gold/
* mips.cc (class Mips_output_section_options): New class.
(Target_mips::do_make_output_section): New method.

c384746 2017-03-16 08:51:35 Vladimir Radosavljevic

Improve relocation overflow errors on MIPS.

gold/
* mips.cc (Mips_relocate_functions::rel26): Don't print relocation
overflow error message.
(Target_mips::relocate_special_relocatable): Improve relocation
overflow error message.
(Target_mips::Relocate::relocate): Likewise.

453018b 2017-03-16 08:51:35 Vladimir Radosavljevic

Correct the definition of _gp and _GLOBAL_OFFSET_TABLE_ symbols for MIPS.

gold/
* mips.cc (symbol_refs_local): Return false if a symbol
is from a dynamic object.
(Target_mips::got_section): Make _GLOBAL_OFFSET_TABLE_ STV_HIDDEN.
(Target_mips::set_gp): Refactor. Make _gp STT_NOTYPE and
STB_LOCAL.
(Target_mips::do_finalize_sections): Set _gp after all the checks
for creating .got are done.
(Target_mips::Scan::global): Remove unused code.

b416fe8 2017-03-15 23:47:52 Kito Cheng

RISC-V: Fix assembler for c.li, c.andi and c.addiw

- They can accept 0 in imm field

2017-03-14 Kito Cheng <kito.cheng@gmail.com>

* riscv-opc.c (riscv_opcodes> <c.li>: Use the 'o' immediate encoding.
<c.andi>: Likewise.
<c.addiw> Likewise.

03b039a 2017-03-15 23:47:52 Kito Cheng

RISC-V: Fix assembler for c.addi, rd can be x0

opcodes/ChangeLog:

2017-03-14 Kito Cheng <kito.cheng@gmail.com>

* riscv-opc.c (riscv_opcodes) <c.addi>: Use match_opcode.

9494d96 2017-03-15 18:23:19 Tristan Gingold

ld-checks: tweak overflow checks.

* testsuite/ld-checks/checks.exp (overflow_check): Disable for
non-elf targets.

7cb7b94 2017-03-15 18:19:42 Nick Clifton

Fix building riscv targets with gcc v6.3.1

* config/tc-riscv.c (riscv_pre_output_hook): Fix compile time
warning about discarding a const qualifier.

cc7e96c 2017-03-15 09:00:36 GDB Administrator

Automatic date update in version.in

c987632 2017-03-15 04:57:48 H.J. Lu

Add DW_OP_GNU_variable_value

Sync GCC dwarf.def change

2017-03-14 Jakub Jelinek <jakub@redhat.com>

PR debug/77589
* dwarf2.def (DW_OP_GNU_variable_value): New opcode.

87c336f 2017-03-15 03:20:46 Andreas Arnez

inf-ptrace: Do not stop memory transfers after a single word

When inf_ptrace_xfer_partial performs a memory transfer via ptrace with
PT_READ_I, PT_WRITE_I (aka PTRACE_PEEKTEXT, PTRACE_POKETEXT), etc., then
it currently transfers at most one word. This behavior yields degraded
performance, particularly if the caller has significant preparation work
for each invocation. And indeed it has for writing, in
memory_xfer_partial in target.c, where all of the remaining data to be
transferred is copied to a temporary buffer each time, for breakpoint
shadow handling. Thus large writes have quadratic runtime and can take
hours.

Note: On GNU/Linux targets GDB usually does not use
inf_ptrace_xfer_partial for large memory transfers, but attempts a single
read/write from/to /proc/<pid>/mem instead. However, the kernel may
reject writes to /proc/<pid>/mem (such as kernels prior to 2.6.39), or
/proc may not be mounted. In both cases GDB falls back to the ptrace
mechanism.

This patch fixes the performance issue by attempting to fulfill the whole
transfer request in inf_ptrace_xfer_partial, using a loop around the
ptrace call.

gdb/ChangeLog:

PR gdb/21220
* inf-ptrace.c (inf_ptrace_xfer_partial): In "case
TARGET_OBJECT_MEMORY", extract the logic for ptrace peek/poke...
(inf_ptrace_peek_poke): ...here. New function. Now also loop
over ptrace peek/poke until end of buffer or error.

d47c3ff 2017-03-15 01:51:29 Kuan-Lin Chen

RISC-V: Define DWARF2_USE_FIXED_ADVANCE_PC.

gas/ChangeLog

2017-03-02 Kuan-Lin Chen <rufus@andestech.com>

* config/tc-riscv.h (HWARD2_USE_FIXED_ADVANCE_PC): New define.

2aece2b 2017-03-15 01:51:29 Kuan-Lin Chen

RISC-V: Fix DW_CFA_advance_loc relocation.

gas/ChangeLog:

2017-03-02 Kuan-Lin Chen <rufus@andestech.com>

* config/tc-riscv.c (md_apply_fix): Set fx_frag and
fx_next->fx_frag for CFA_advance_loc relocations.

c1b465c 2017-03-15 01:51:29 Kuan-Lin Chen

RISC-V: Fix the offset of CFA relocation.

gas/ChangeLog:

2017-03-02 Kuan-Lin Chen <rufus@andestech.com>

* config/tc-riscv.c (md_apply_fix): Compute the correct offsets
for CFA relocations.

2c232b8 2017-03-15 01:23:18 Andrew Waterman

RISC-V: Fix [dis]assembly of srai/srli

These were simple copy/paste errors from the compressed left shift
pattern, which can't have a 0-register.