• R/O
  • HTTP
  • SSH
  • HTTPS

コミット一覧

タグ
未設定

よく使われているワード(クリックで追加)

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

GNU Binutils with patches for OS216


users/palves/core-prstatus-rework
RSS
Rev. 日時 作者
3a36c1c users/palves/core-prstatus-rework 2016-01-22 09:36:13 Alan Modra

Remove elf_backend_write_core_note

This function was added in 2007 to support powerpc gdb "gcore" writing
32-bit powerpc linux core files on a 64-bit powerpc host, when
PowerPC64 glibc lacked (and still lacks) 32-bit versions of prstatus_t
and prpsinfo_t. Now that gdb has elfcore_write_linux_prstatus32/64
and elfcore_write_linux_prpsinfo32/64, this linux specific backend
function should disappear.

* elf-bfd.h (struct elf_backend_data): Remove
elf_backend_write_core_note.
* elf.c (elfcore_write_prpsinfo, elfcore_write_prstatus): Don't call
elf_backend_write_core_note.
* elf32-arm.c (elf32_arm_nabi_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
* elf32-ppc.c (ppc_elf_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
* elf64-ppc.c (ppc64_elf_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
* elf64-x86-64.c (elf_x86_64_write_core_note): Delete function.
(elf_backend_write_core_note): Don't define.
(CORE_HEADER): Don't include.
* elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Delete function.
* elfxx-aarch64.h (_bfd_aarch64_elf_write_core_note): Delete prototype.
(elf_backend_write_core_note): Don't define.
* elfxx-target.h (elf_backend_write_core_note): Don't define.
(elfNN_bed): Adjust.
* hosts/x86-64linux.h: Delete file.
* configure.ac (CORE_HEADER): Delete.
* configure: Regenerate.
* config.in: Regenerate.

abd215c 2016-01-22 08:30:34 Alan Modra

x32 write_linux_prstatus

x32 uses an elf_gregset64_t in the prstatus struct, which aligns the
struct to eight bytes. This means four bytes of padding at the end of
the struct.

* amd64-linux-tdep.c: Include elf-bfd.h.
(amd64_x32_write_linux_prstatus): New function.
(amd64_x32_linux_init_abi): Use it.
* linux-tdep.c (linux_collect_regset_section_cb): Allocate an
extra four bytes for regset buffer.
* gdbarch.sh (elfcore_write_linux_prstatus): Remove const from info.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.

e2b337e 2016-01-21 20:45:38 Alan Modra

Use elfcore_write_linux_prstatus in gdb

The gdb side. Nothing fancy here, though it'd be easier to fill in
more fields now. Targets that are known to need a custom
gdbarch_elfcore_write_linux_prstatus but don't have one yet can
install a stop-gap hook implementation that still calls into
elfcore_write_prstatus. It is currently installed for MIPS n32 and
Sparc64 (though we're not writting any of pr_{u,s,cu,cs}time yet), and
x86-64 x32 too.

Signed-off-by: Pedro Alves <palves@redhat.com>

3ccd529 2016-01-21 20:45:37 Alan Modra

Linux core prstatus support

This and the next patch are the first steps towards making gcore
support writing NT_PRSTATUS on remote/cross targets. I'm not going to
commit this one and I'm hoping someone from the gdb camp will run with
it as I'm going to be busy with other things in the near future.

a994041 2016-01-21 20:18:45 Pedro Alves

gdb: Respect CXXFLAGS when building with C++ compiler

Currently, even when built with --enable-build-with-cxx, gdb uses
CFLAGS instead of CXXFLAGS. This commit fixes it.

CXXFLAGS set in the environment when configure was run is now honored
in the generated gdb/Makefile, and you can also override CXXFLAGS in
the command like at make time, with the usual 'make CXXFLAGS="..."'

Objects built with a C compiler (e.g., gnulib) still honor CFLAGS
instead.

gdb/ChangeLog:
2016-01-21 Pedro Alves <palves@redhat.com>

* Makefile.in (COMPILER_CFLAGS): New.
(CXXFLAGS): Get it from configure.
(INTERNAL_CFLAGS_BASE, INTERNAL_LDFLAGS): Use COMPILER_CFLAGS
instead of CFLAGS.
* build-with-cxx.m4 (GDB_AC_BUILD_WITH_CXX): Set and AC_SUBST
COMPILER_CFLAGS.
* configure: Regenerate.

gdb/gdbserver/ChangeLog:
2016-01-21 Pedro Alves <palves@redhat.com>

* Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New.
(INTERNAL_CFLAGS_BASE): Use COMPILER_CFLAGS instead of CFLAGS.
* configure: Regenerate.

aebf9be 2016-01-21 19:51:25 Nick Clifton

Fix unexpected failures in the linker testsuite for ARM VxWorks targets.

PR ld/19455
* elf32-arm.c (elf32_arm_create_dynamic_sections): Set the ELF
class of the linker stub bfd.
(elf32_arm_check_relocs): Skip check for pic format after
processing a vxWorks R_ARM_ABS12 reloc.
* elflink.c (bfd_elf_final_link): Check for ELFCLASSNONE when
reporting a class mismatch.

* testsuite/ld-arm/vxworks1-lib.dd: Update for current
disassmebler output.
* testsuite/ld-arm/vxworks1-lib.rd: Likewise.
* testsuite/ld-arm/vxworks1.dd: Likewise.
* testsuite/ld-arm/vxworks1.rd: Likewise.
* testsuite/ld-arm/vxworks1.ld: Set the output format.

305e13e 2016-01-21 19:23:15 Joel Brobecker

Fix regression introduced in "break *<EXPR>" by explicit location patches.

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

2f34066 2016-01-21 18:57:09 Jiong Wang

[AArch64] Relax long branch veneer insertion for non STT_FUNC symbol

As defined at AArch64 ELF Specification (4.6.7 Call and Jump
relocations), symbol with type of non STT_FUNC but in different input
section with relocation place should insert long branch veneer also.

Meanwhile the current long branch veneer infrastructure havn't considered
the situation where the branch destination is "sym_value + rela->addend".

This was OK because we only insert veneer for long call destination is
STT_FUNC symbol for which the addend is always zero. But as we relax the
support to other situations by this patch, we need to handle addend be
non-zero value. For example, for static function, relocation against
"local symbol" are turned into relocation against "section symbol + offset"
where there is a valid addend.

bfd/
* elfnn-aarch64.c (aarch64_type_of_stub): Allow insert long branch
veneer for sym_sec != input_sec.
(elfNN_aarch64_size_stub): Support STT_SECTION symbol.
(elfNN_aarch64_final_link_relocate): Take rela addend into account when
calculation destination.

ld/
* testsuite/ld-aarch64/farcall-section.d: Delete.
* testsuite/ld-aarch64/farcall-section.s: Delete.
* testsuite/ld-aarch64/farcall-b-section.d: New expectation file.
* testsuite/ld-aarch64/farcall-bl-section.d: Likewise.
* testsuite/ld-aarch64/farcall-b-section.s: New testcase.
* testsuite/ld-aarch64/farcall-bl-section.s: Likewise.
* testsuite/ld-aarch64/aarch64-elf.exp: Likewise.

aeb7056 2016-01-21 18:29:33 Alan Modra

Convert macros in elf-linux-core.h to inline functions

Besides changing some macros into inline functions, this removes
redundant memsets and uses bfd_put_* rather than H_PUT_*.

* elf-linux-core.h (swap_linux_prpsinfo32_out): New function.
(swap_linux_prpsinfo64_out): New function.
(LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
(LINUX_PRPSINFO64_SWAP_FIELDS): Delete.
* elf.c (elfcore_write_linux_prpsinfo32): Adjust. Don't memset.
(elfcore_write_linux_prpsinfo64): Likewise.
* elf32-ppc.c (swap_ppc_linux_prpsinfo32_out): New function.
(PPC_LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
(elfcore_write_ppc_linux_prpsinfo32): Adjust. Don't memset.

de64ce1 2016-01-21 18:29:33 Alan Modra

Rename elf-linux-psinfo.h to elf-linux-core.h

Since it will sometime have more than just prpsinfo. Also,
elf32-ppc.c needlessly includes this header.

* elf-linux-core.h: Rename from elf-linux-psinfo.h.
* elf.c: Adjust #include.
* elf32-ppc.c: Don't #include elf-linux-psinfo.h
* Makefile.am (SOURCE_HFILES): Update.
* Makefile.in: Regenerate.
* po/SRC-PORFILES.in: Regenerate.

c603b11 2016-01-21 18:29:33 Alan Modra

bfd/configure reorganisation

Corefile code should be moved after running config.bfd, because it
uses want64.

* configure.ac: Move corefile selection later in file. Move
tdefaults code immediately after other target vector code.
* configure: Regenerate.

f7a6a40 2016-01-21 16:48:50 Yao Qi

Detect the arm/thumb mode of code SIGRETURN or RT_SIGRETURN returns to

This patch fixes the following regression introduced by commit d0e59a68

step^M
39 } /* handler */^M
1: x/i $pc^M
=> 0x8740 <handler+80>: sub sp, r11, #0^M
(gdb) step^M
^M
Program received signal SIGSEGV, Segmentation fault.^M
setitimer () at ../sysdeps/unix/syscall-template.S:81^M
81 ../sysdeps/unix/syscall-template.S: No such file or directory.^M
1: x/i $pc^M
=> 0xb6eff9c0 <setitimer>: push {r7}^M
(gdb) FAIL: gdb.base/sigstep.exp: continue to handler, si+advance in handler, step from handler: leave handler

in my test setting, program is compiled in arm mode, but the glibc
is built in thumb mode, so when we do 'step' to step over syscall
instruction svc for SIGRETURN, GDB should set breakpoint for arm mode
in the program, even though the current program in glibc is in thumb
mode. Current GDB doesn't consider the case that the mode of program
SIGRETURN goes to can be different from current program mode.

In fact, GDB has taken care of this arm/thumb mode changes already,
see

/* Copy the value of next pc of sigreturn and rt_sigrturn into PC,
return 1. In addition, set IS_THUMB depending on whether we
will return to ARM or Thumb code. Return 0 if it is not a
rt_sigreturn/sigreturn syscall. */
static int
arm_linux_sigreturn_return_addr (struct frame_info *frame,
unsigned long svc_number,
CORE_ADDR *pc, int *is_thumb)

but in the commit d0e59a68

> - arm_linux_sigreturn_return_addr (frame, svc_number, &return_addr, &is_thumb);
> + if (svc_number == ARM_SIGRETURN || svc_number == ARM_RT_SIGRETURN)
> + next_pc = arm_linux_sigreturn_next_pc (regcache, svc_number);

the IS_THUMB setting is lost, so it is a regression.

gdb:

2016-01-21 Yao Qi <yao.qi@linaro.org>

* arm-linux-tdep.c (arm_linux_sigreturn_next_pc): Add parameter
is_thumb and set it according to CPSR saved on the stack.
(arm_linux_get_next_pcs_syscall_next_pc): Pass is_thumb to
arm_linux_sigreturn_next_pc.

gdb/gdbserver:

2016-01-21 Yao Qi <yao.qi@linaro.org>

* linux-arm-low.c (arm_sigreturn_next_pc): Add parameter
is_thumb and set it according to CPSR saved on the stack.
(get_next_pcs_syscall_next_pc): Pass is_thumb to
arm_sigreturn_next_pc.

7304afd 2016-01-21 09:00:08 GDB Administrator

Automatic date update in version.in

5f5dfff 2016-01-21 03:44:33 Simon Marchi

Fix sorting of enum values in FlagEnumerationPrinter

The lambda function used to sort the enumerator list does not work
properly. This list consists of tuples, (enum label, enum value). The
key function returns x.enumval. enumval not being defined for a tuple,
we see this exception in the test log:

Python Exception <class 'AttributeError'> 'tuple' object has no attribute 'enumval'

The function should return the second item of the tuple, which is the
enumval.

The pretty-printer still worked mostly correctly, except that the
enumeration values were not sorted. The test still passed because the
enumeration values are already sorted where they are defined. The test
also passed despite the exception being printed, because the right output
was printed after the exception:

print (enum flag_enum) (FLAG_1)
Python Exception <type 'exceptions.AttributeError'> 'tuple' objecthas no attribute 'enumval':M
$7 = 0x1 [FLAG_1]
(gdb) PASS: gdb.python/py-pp-maint.exp: print FLAG_1

New in v2:

- Improved test case, I stole Pedro's example directly. It verifies
that the sorting of enumerators by value works, by checking that
printing FOO_MASK appears as FOO_1 | FOO_2 | FOO_3.

I noticed that I could change the regexps to almost anything and the
tests would still pass. I think it was because of the | in there. I
made them more robust by using string_to_regexp. I used curly braces
{ } instead of quoting marks " " for strings, so that I could use
square brackets [ ] in them without having to escape them all. I also
removed the "message" part of the tests, since they are redundant with
the command, and it's just more maintenance to have to update them.

Tested with Python 2.7 and 3.5.

gdb/ChangeLog:

* python/lib/gdb/printing.py (FlagEnumerationPrinter.__call__):
Fix enumerators sort key function.

gdb/testsuite/ChangeLog:

* gdb.python/py-pp-maint.exp: Change/add enum flag tests.
* gdb.python/py-pp-maint.c (enum flag_enum): Use more complex
enum flag values.

fd356fa 2016-01-21 03:41:45 Andreas Arnez

gnu_vector.exp: Respect `should_kfail' for PR 8549

The gnu_vector test case yields a new FAIL on s390x:

FAIL: gdb.base/gnu_vector.exp: verify vector return value

It was introduced by commit 77ae9c1933b50 "gdb.base/gnu_vector.exp:
Don't test output from the inferior". That commit dropped the special
handling for GDB's inability (on some targets) to set the return value.

This change re-establishes the logic from before, converting the above
FAIL to a KFAIL (PRMS gdb/8549).

gdb/testsuite/ChangeLog:

* gdb.base/gnu_vector.exp: Re-establish handling for should_kfail
when GDB can not set the vector return value. Add more comments
for clarification.

9df2217 2016-01-21 02:30:53 Antoine Tremblay

Fix missing IPA lib in tspeed.exp in some configurations.

On Ubuntu 14.04 the following failure would be seen when running the
tspeed.exp test on a target that supports fast tracepoints like x86_64:

Target returns error code '.In-process agent library not loaded in
process. Fast and static tracepoints unavailable.'.
(gdb) FAIL: gdb.trace/tspeed.exp: start trace experiment

This is because the default is to link with --as-needed and the
gdb_compile for the test is using the libs argument instead of shlib which
corrects this issue since 6ebea266fd0a7a56c90db3ab6237ff9f6c919747 by
adding -Wl,--no-as-needed.

This patch fixes the issue by passing the lib as the shlib argument to
gdb_compile.

Tested on Ubuntu 14.04 x86_64.

gdb/testsuite/ChangeLog:

* gdb.trace/tspeed.exp: Use shlib instead of libs in gdb_compile
command.

74b92a5 2016-01-21 02:02:42 Nick Clifton

Fix unexpected failures in GAS testsuite for ARM VxWorks target.

PR 19456
* testsuite/gas/arm/weakdef-1.d: Skip for VxWorks.
* testsuite/gas/arm/blx-bl-convert.d
* testsuite/gas/arm/plt-1.d: Likewise.
* testsuite/gas/arm/reloc-bad.d: Likewise.
* testsuite/gas/arm/thumb-w-good.d: Likewise.
* testsuite/gas/arm/thumb2_pool.d: Likewise.
* testsuite/gas/arm/ldconst.d: Adjust so that it works with VxWorks
* testsuite/gas/arm/tls_vxworks.d: Update expected output.

72e0b25 2016-01-21 01:21:34 Nick Clifton

Upda the documentation on assembler error message generation.

PR 19499
* doc/as.texinfo (Errors): Correct documentation describing the
interaction of .file and .line with warning and error messages.

fdbd3e9 2016-01-21 00:41:06 Nick Clifton

Fix linker testsuite failures for arm-pe targets.

PR 19457
* testsuite/ld-scripts/script.exp (extract_symbol_test): Stop test
early for PE based targets.
* testsuite/ld-scripts/align.t: Use 0x1000 as VMA alignment.
* testsuite/ld-pe/tlssec32.d: Allow for relocatable output.

aed5fc7 2016-01-21 00:00:57 Nick Clifton

Skip ARM v8 tests for COFF based targets.

0398b8d 2016-01-20 23:52:33 Nick Clifton

Fix dlltool tests for ARM targets, which do not support the --leading-underscore option.

PR 19495
* testsuite/binutils-all/dlltool.exp: Fix tests for targets which
do not support inserting leading underscores.

0bff6e2 2016-01-20 23:25:46 Matthew Wahab

[AArch64] Reject invalid immediate operands to MSR UAO

In the instruction to write to the ARMv8.2 PSTATE field UAO,
MSR UAO, #<imm>, the immediate should be either 0 or 1 but GAS accepts
any unsigned 4-bit integer.

This patch implements the constraint on the immediate, generating an
error if the immediate operand is invalid, and adds tests for the
illegal forms.

opcodes/
2016-01-20 Matthew Wahab <matthew.wahab@arm.com>

* aarch64-opc.c (operand_general_constraint_met_p): Check validity
of MSR UAO immediate operand.

gas/
2016-01-20 Matthew Wahab <matthew.wahab@arm.com>

* testsuite/gas/aarch64/armv8_2-a-illegal.d: New.
* testsuite/gas/aarch64/armv8_2-a-illegal.l: New.
* testsuite/gas/aarch64/armv8_2-a-illegal.s: New.

Change-Id: Ibdec4967c00b1ef3be9dbc43d23b2c70d1a0b28c

b12e561 2016-01-20 22:10:41 Pedro Alves

Fix gdb/ChangeLog typo

37e42b4 2016-01-20 22:03:40 Pedro Alves

Move ChangeLog entry to proper place (gdb/testsuite/ -> gdb/)

91f68a6 2016-01-20 21:53:50 Mickael Guene

Add support for an ARM specific 'y' section attribute flag to mark the section as NOREAD.

bfd/ChangeLog:
* elf32-arm.c ((elf32_arm_special_sections): Remove catch of noread
section using '.text.noread' pattern.

gas/ChangeLog:
* config/obj-elf.c (obj_elf_change_section) : Allow arm section with
SHF_ARM_NOREAD section flag.
* config/tc-arm.h (md_elf_section_letter) : Implement this hook to
handle letter 'y'.
(arm_elf_section_letter) : Declare it.
* config/tc-arm.c (arm_elf_section_letter): Handle letter 'y' to set
SHF_ARM_NOREAD section flag.
* doc/c-arm.texi (ARM section attribute 'y'): Document it.

gas/testsuite/ChangeLog:
* gas/arm/section-execute-only.s: New test case.
* gas/arm/section-execute-only.d: Expected output.

ld/testsuite/ChangeLog:
* ld-arm/thumb1-noread-not-present-mixing-two-section.s: Add 'y'
attribute usage.
* ld-arm/thumb1-noread-present-one-section.s: Likewise.
* ld-arm/thumb1-noread-present-two-section.s: Likewise.
* ld-arm/thumb1-input-section-flag-match.s: Likewise.

binutils/ChangeLog:
* readelf.c (get_elf_section_flags): Display y letter for section
with SHF_ARM_NOREAD section flag in readelf section output.
(process_section_headers): Add y letter in readelf section output
key mapping for ARM architecture.

be56871 2016-01-20 13:03:44 Joel Brobecker

minor reformatting in printcmd.c::print_scalar_formatted

(GNU Coding Standard...)

gdb/ChangeLog:

* printcmd.c (print_scalar_formatted): move binary operator from
end of line to beginning of next line. Adjust formatting
accordingly.

e36a770 2016-01-20 09:00:10 GDB Administrator

Automatic date update in version.in

f2feec9 2016-01-20 04:35:19 John Baldwin

Use a separate variable for the size passed to sysctl.

This fixes a sign mismatch warning.

gdb/ChangeLog:

* fbsd-nat.c (fbsd_pid_to_exec_file): Use new "buflen" instead of
"len" with sysctl.

40068dc 2016-01-20 02:06:33 John Baldwin

Remove an unused variable.

binutils/ChangeLog:

* readelf.c (get_freebsd_elfcore_note_type): Remove unused variable.

20a0aab 2016-01-20 01:19:40 John Baldwin

Dump register notes for each thread when generating a FreeBSD core.

gdb/ChangeLog:

* fbsd-tdep.c (find_stop_signal): Remove.
(struct fbsd_collect_regset_section_cb) <lwp>: New field.
<stop_signal>: New field.
<abort_iteration>: New field.
(fbsd_collect_regset_section_cb): Use new fields.
(fbsd_collect_thread_registers): New function.
(struct fbsd_corefile_thread_data): New structure.
(fbsd_corefile_thread): New function.
(fbsd_make_corefile_notes): Use new function to dump notes for each
non-exited thread in a process.