This patch enables x32 for x86_64-*-elf* for embedded target and disables
rex tests since it uses '/' as prefix separator which is `\' for
x86_64-*-elf*.
bfd/
* config.bfd (targ_selvecs): Add bfd_elf32_x86_64_vec for
x86_64-*-elf*.
gas/testsuite/
* gas/i386/rex.d: Skip x86_64-*-elf*.
* gas/i386/ilp32/rex.d: Likewise.
ld/
* configure.tgt (targ_extra_emuls): Adds elf32_x86_64 for
x86_64-*-elf*.
(targ_extra_libpath): Likewise.
(tdir_elf_i386): Replace x86_64 with i386 for x86_64-*-elf*.
* elf32-arm.c (elf32_arm_allocate_plt_entry): If HTAB->nacl_p,
allocate space for PLT header even if IS_IPLT_ENTRY.
(arm_nacl_put_plt0): New function, broken out of ...
(elf32_arm_finish_dynamic_sections): ... here. Call it.
If HTAB->nacl_p, set up the PLT header in .iplt too.
(elf32_arm_output_arch_local_syms): If HTAB->nacl_p, write
a mapping symbol for the start of .iplt too.
PR gdb/10462
* cli/cli-decode.c (lookup_command): Show an error if there is no space
before argument.
2013-04-24 Muhammad Bilal <mbilal@codesourcery.com>
PR gdb/10462
* gdb.base/setshow.exp: Add test case.
PR gdb/15165
* breakpoint.c (dprintf_print_recreate): New.
(save_breakpoints): Let it not save dprintf commands.
(initialize_breakpoint_ops): Set dprintf_print_recreate.
2013-04-23 Hui Zhu <hui@codesourcery.com>
PR gdb/15165
* gdb.base/save-bp.exp: Add test for dprintf.
* remote-sim.c (dump_mem): Change the type of 'buf' parameter from
'char *' to 'gdb_byte *'.
(gdbsim_store_register): Change the type of 'tmp' from 'char' to
'gdb_byte'.
--enable-64-bit-bfd. Basically the issue happens when dealing with "bl"
instructions: GDB does branch destination calculation and (wrongly)
sign-extends the PC. Here is a piece of his original message explaining
the problem:
> next_pc = arm_get_next_pc (frame, get_frame_pc (frame));
>
> /* The Linux kernel offers some user-mode helpers in a high page. We can
> not read this page (as of 2.6.23), and even if we could then we couldn't
> set breakpoints in it, and even if we could then the atomic operations
> would fail when interrupted. They are all called as functions and return
> to the address in LR, so step to there instead. */
> if (next_pc > 0xffff0000)
> next_pc = get_frame_register_unsigned (frame, ARM_LR_REGNUM);
>
> arm_insert_single_step_breakpoint (gdbarch, aspace, next_pc);
>
> Unfortunately, branch destination addresses are SIGN EXTENDED to 64
> bits. So,
>
> (top-gdb) p/x next_pc
> $14 = 0xffffffffb6df2864
>
> Which triggers the next_pc = get_frame_register_unsigned(), and we
> cannot step into any branches because the destination PC is wrong.
Anyway, the fix is simple and Andrew himself provided it for us. It
took a while for me to figure out how to trigger the bug (in order to
write a testcase for it), but I finally made it.
The attached patch fixes the problem (by casting to `unsigned long'
instead of just `long'), and also includes a testcase to reproduce the
issue.
gdb/ChangeLog:
2013-04-22 Andrew Haley <aph@redhat.com>
* arm-tdep.c (BranchDest): Cast result as "unsigned long",
instead of "long".
gdb/testsuite/ChangeLog:
2013-04-22 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.arch/arm-bl-branch-dest.c: New file.
* gdb.arch/arm-bl-branch-dest.exp: Likewise.
* ctf.c (ctf_fetch_registers): Change the type of 'regs' from
'char *' to 'gdb_byte *'. Cast the return value of
'bt_ctf_get_char_array' to 'gdb_byte *'.
"signedness" is more typical.
gdb/doc/
2013-04-19 Pedro Alves <palves@redhat.com>
* gdbint.texinfo (Misc Guidelines) <Compiler Warnings>: Write
"signedness" instead of "signness".
This enables -Wpointer-sign by default.
I've checked that --enable-targets=all builds fine with the following
as --host, on x86_64 Fedora 17 --build:
x86_64 GNU/Linux
i386 GNU/Linux
i386 MinGW-w64
i386 msdos/djgpp
OK?
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* configure.ac (build_warnings): Replace -Wno-pointer-sign with
-Wpointer-sign.
* configure: Regenerate.
gdb/doc
2013-04-19 Pedro Alves <palves@redhat.com>
* gdbint.texinfo (Misc Guidelines) <Compiler Warnings>: Replace
-Wno-pointer-sign text with text on -Wpointer-sign.
This is the remaining issue impeding GDB to build with "-Wpointer-sign
-Werror" with Fedora 17's i686-w64-mingw32 cross toolchain.
../../src/gdb/ser-tcp.c: In function 'net_read_prim':
../../src/gdb/ser-tcp.c:341:3: error: pointer targets in passing argument 2 of 'recv' differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/serial.h:23:0,
from ../../src/gdb/ser-tcp.c:21:
/usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:983:34: note: expected 'char *' but argument is of type 'unsigned char *'
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* ser-tcp.c (net_read_prim): Cast second argument to recv to
'void *'.
This fixes -Wpointer-sign issues in monitor.c.
Tested by building on x86_64 Fedora 17 w/ --enable-targets=all.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* monitor.c (monitor_write_memory, monitor_write_memory_bytes):
Change type of 'myaddr' parameter to gdb_byte pointer.
(monitor_write_memory_longlongs): Likewise. Cast 'myaddr' pointer
to 'long long' pointer instead of to 'unsigned long long'.
(monitor_write_memory_block, monitor_read_memory_single)
(monitor_read_memory): Change type of 'myaddr' parameter to
gdb_byte pointer.
../../src/gdb/record.c: In function ‘set_record_insn_history_size’:
../../src/gdb/record.c:670:5: error: pointer targets in passing argument 2 of ‘validate_history_size’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/record.c:646:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
../../src/gdb/record.c: In function ‘set_record_call_history_size’:
../../src/gdb/record.c:682:5: error: pointer targets in passing argument 2 of ‘validate_history_size’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/record.c:646:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
This fixes it in the obvious way.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* record.c (validate_history_size): Make parameter 'setting'
unsigned.
ctf_save_write's second parameter is gdb_byte *, and all these
arguments are 'char *'. Since this function is ultimately just
writing host bytes to a local file with fwrite, an alternative would
be to change ctf_save_write to take a 'void *' instead of 'gdb_byte
*', thus removing the need for any cast (we have more calls with casts
than without).
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* ctf.c (ctf_write_uploaded_tsv, ctf_write_uploaded_tp): Add casts
to 'gdb_byte *'.
Fix:
../../src/gdb/cp-valprint.c: In function ‘cp_print_class_member’:
../../src/gdb/cp-valprint.c:793:3: error: pointer targets in passing argument 2 of ‘cp_find_class_member’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/cp-valprint.c:721:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
'fieldno' is used throughout as 'int', so just follow the trend.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* cp-valprint.c (cp_print_class_member): Change type of 'fieldno'
local to int.
We're reading strings using the target memory access routines, which
work with raw bytes, so we need a couple casts.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* ada-lang.c (print_it_exception): Add cast to gdb_byte *.
* ada-tasks.c (read_fat_string_value): Likewise.
The 'bytes_read' change should be obvious. As for the other hunk,
we're passing the address of the signed 'offset' to safe_read_uleb128,
which expects unsigned. Fix it by passing the address of the unsigned
'utmp' instead, like already done on other spots in the file.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* dwarf2-frame.c (execute_cfa_program): Make 'bytes_read' local
unsigned. Pass 'tmp' to safe_read_uleb128 instead of the signed
'offset', and adjust.
This fixes the remaining issues necessary to make the DWARF reader
-Wpointer-sign clean. The 'filename' bit should be obvious.
'constant_pool' holds the contents of an obstack, which are 'char *'.
gdb_byte would work too, but it'd need more casts elsewhere, so I just
chose the minimal approach. Any way would be fine with me.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* dwarf2read.c (dwarf2_get_dwz_file): Add cast to const char *.
(read_index_from_section): Add cast to 'char *'.
../../src/gdb/xcoffread.c: In function ‘xcoff_initial_scan’:
../../src/gdb/xcoffread.c:2982:17: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
'debugsec' is a 'bfd_byte *', holding the result of a
bfd_get_full_section_contents. 'info->debugsec' holds the same
contents throughout the whole xcoff read, and everywhere it's used to
read symbol names. Simply adding a cast feels appropriate.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* xcoffread.c (xcoff_initial_scan): Add cast to 'char *'.
A couple places take a pointer to the middle of some raw section
buffer and treat them as strings. Add casts to char * as appropriate,
fixing -Wpointer-sign warnings.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* coff-pe-read.c (read_pe_exported_syms): Handle strings as char.
Bookmarks are opaque to the core code -- by design, the target is free
to use any sort of blob as bookmark identifier.
The record target chooses to use strings for bookmarks. This adds
casts following that direction, fixing -Wpointer-sign warnings.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* record-full.c (record_full_get_bookmark): Change local 'ret'
type to char * and add cast to gdb_byte *.
(record_full_goto_bookmark): Handle 'bookmark' argument as a
string.
* reverse.c (goto_bookmark_command): Add casts to gdb_byte *.