1. 22 Apr, 2013 11 commits
    • Jan-Benedict Glaw's avatar
      2013-04-22 Jan-Benedict Glaw <jbglaw@lug-owl.de> · b836cb18
      Jan-Benedict Glaw authored
      	* Makefile.def: Sync with GCC.
      	* Makefile.in: Regenerate.
      b836cb18
    • Tom Tromey's avatar
      PR gdb/7912: · 614c279d
      Tom Tromey authored
      	* Makefile.in (SFILES): Add filestuff.c
      	(COMMON_OBS): Add filestuff.o.
      	(filestuff.o): New target.
      	* auto-load.c (auto_load_objfile_script_1): Use
      	gdb_fopen_cloexec.
      	* auxv.c (procfs_xfer_auxv): Use gdb_open_cloexec.
      	* cli/cli-cmds.c (shell_escape): Call close_most_fds.
      	* cli/cli-dump.c (fopen_with_cleanup): Use gdb_fopen_cloexec.
      	* common/agent.c (gdb_connect_sync_socket): Use
      	gdb_socket_cloexec.
      	* common/filestuff.c: New file.
      	* common/filestuff.h: New file.
      	* common/linux-osdata.c (linux_common_core_of_thread)
      	(command_from_pid, commandline_from_pid, print_source_lines)
      	(linux_xfer_osdata_shm, linux_xfer_osdata_sem)
      	(linux_xfer_osdata_msg, linux_xfer_osdata_modules): Use
      	gdb_fopen_cloexec.
      	* common/linux-procfs.c (linux_proc_get_int)
      	(linux_proc_pid_has_state): Use gdb_fopen_cloexec.
      	* config.in, configure: Rebuild.
      	* configure.ac: Don't check for sys/socket.h.  Check for
      	fdwalk, pipe2.
      	* corelow.c (core_open): Use gdb_open_cloexec.
      	* dwarf2read.c (write_psymtabs_to_index): Use gdb_fopen_cloexec.
      	* fork-child.c (fork_inferior): Call close_most_fds.
      	* gdb_bfd.c (gdb_bfd_open): Use gdb_open_cloexec.
      	* inf-child.c (inf_child_fileio_readlink): Use gdb_open_cloexec.
      	* linux-nat.c (linux_nat_thread_name, linux_proc_pending_signals):
      	Use gdb_fopen_cloexec.
      	(linux_proc_xfer_partial, linux_proc_xfer_spu): Use
      	gdb_open_cloexec.
      	(linux_async_pipe): Use gdb_pipe_cloexec.
      	* remote-fileio.c (remote_fileio_func_open): Use
      	gdb_open_cloexec.
      	* remote.c (remote_file_put, remote_file_get): Use
      	gdb_fopen_cloexec.
      	* ser-pipe.c (pipe_open): Use gdb_socketpair_cloexec,
      	close_most_fds.
      	* ser-tcp.c (net_open): Use gdb_socket_cloexec.
      	* ser-unix.c (hardwire_open): Use gdb_open_cloexec.
      	* solib.c (solib_find): Use gdb_open_cloexec.
      	* source.c (openp, find_and_open_source): Use gdb_open_cloexec.
      	* tracepoint.c (tfile_start): Use gdb_fopen_cloexec.
      	(tfile_open): Use gdb_open_cloexec.
      	* tui/tui-io.c (tui_initialize_io): Use gdb_pipe_cloexec.
      	* ui-file.c (gdb_fopen): Use gdb_fopen_cloexec.
      	* xml-support.c (xml_fetch_content_from_file): Use
      	gdb_fopen_cloexec.
      	* main.c (captured_main): Call notice_open_fds.
      gdbserver
      	* Makefile.in (SFILES): Add filestuff.c.
      	(OBS): Add filestuff.o.
      	(filestuff.o): New target.
      	* config.in, configure: Rebuild.
      	* configure.ac: Check for fdwalk, pipe2.
      614c279d
    • Edjunior Barbosa Machado's avatar
      2013-04-22 Edjunior Machado <emachado@linux.vnet.ibm.com> · 5fda2332
      Edjunior Barbosa Machado authored
      * 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'.
      5fda2332
    • Jan-Benedict Glaw's avatar
      2013-04-22 Jan-Benedict Glaw <jbglaw@lug-owl.de> · e7d5abf1
      Jan-Benedict Glaw authored
      	* configure.ac: Sync with GCC.
      	* configure: Regenerated.
      e7d5abf1
    • Alan Modra's avatar
      PR ld/15382 · 86f7d49b
      Alan Modra authored
      	* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Don't multiply
      	sh_size or reloc_count adjustment by count.
      86f7d49b
    • Yao Qi's avatar
      gdb/ · eb6c553b
      Yao Qi authored
      	* infrun.c: Fix typo in comment.
      eb6c553b
    • Sergio Durigan Junior's avatar
      2013-04-22 Sergio Durigan Junior <sergiodj@redhat.com> · d504301e
      Sergio Durigan Junior authored
      	* gdb.arch/arm-bl-branch-dest.exp: Replace additional_flags by
      	ldflags.
      d504301e
    • Sergio Durigan Junior's avatar
      Andrew Haley found a bug on GDB running on ARM when using · 9991b207
      Sergio Durigan Junior authored
      --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.
      9991b207
    • Alan Modra's avatar
      bfd/ · bfeb4a28
      Alan Modra authored
      	* elf64-ppc.c (ppc64_elf_check_relocs): Don't call
      	create_linkage_sections here..
      	(ppc64_elf_init_stub_bfd): ..do so here.  Return status.
      	(create_linkage_sections): Move earlier in file.
      	(ppc64_elf_setup_section_lists): Remove now useless htab->brlt test.
      	* elf64-ppc.h (ppc64_elf_init_stub_bfd): Update proto.
      ld/
      	* emultempl/ppc64elf.em (ppc_create_output_section_statements):
      	Check return from ppc64_elf_init_stub_bfd.
      ld/testsuite/
      	* ld-powerpc/tlsexe.d: Adjust.
      	* ld-powerpc/tlsexe.r: Adjust.
      	* ld-powerpc/tlsexetoc.d: Adjust.
      	* ld-powerpc/tlsexetoc.r: Adjust.
      	* ld-powerpc/tlsso.d: Adjust.
      	* ld-powerpc/tlsso.r: Adjust.
      	* ld-powerpc/tlstocso.d: Adjust.
      	* ld-powerpc/tlstocso.r: Adjust.
      bfeb4a28
    • gdbadmin's avatar
      *** empty log message *** · 1f81bca1
      gdbadmin authored
      1f81bca1
    • Alan Modra's avatar
      daily update · b82b1bb2
      Alan Modra authored
      b82b1bb2
  2. 21 Apr, 2013 3 commits
  3. 20 Apr, 2013 3 commits
    • Yao Qi's avatar
      gdb/ · 8b4833e3
      Yao Qi authored
      	* 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 *'.
      8b4833e3
    • gdbadmin's avatar
      *** empty log message *** · 67b8da82
      gdbadmin authored
      67b8da82
    • Alan Modra's avatar
      daily update · ada37605
      Alan Modra authored
      ada37605
  4. 19 Apr, 2013 23 commits
    • Pedro Alves's avatar
      s/signness/signedness in gdbint.texinfo. · 5360976e
      Pedro Alves authored
      "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".
      5360976e
    • Pedro Alves's avatar
      Enable -Wpointer-sign by default. · bd3f3b55
      Pedro Alves authored
      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.
      bd3f3b55
    • Hafiz Abid Qadeer's avatar
      2013-04-19 Nathan Froyd <froydnj@codesourcery.com> · 8bf54274
      Hafiz Abid Qadeer authored
      	* ppc-instructions (isel): New instruction.
      8bf54274
    • Pedro Alves's avatar
      Make GDB -Wpointer-sign clean on MinGW too. · c49e7f76
      Pedro Alves authored
      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 *'.
      c49e7f76
    • Pedro Alves's avatar
      -Wpointer-sign: monitor.c. · 12ff8552
      Pedro Alves authored
      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.
      12ff8552
    • Pedro Alves's avatar
      -Wpointer-sign: record.c. · 9c37696b
      Pedro Alves authored
      ../../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.
      9c37696b
    • Pedro Alves's avatar
      -Wpointer-sign: ctf.c. · a398505b
      Pedro Alves authored
      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 *'.
      a398505b
    • Pedro Alves's avatar
      -Wpointer-sign: cp-valprint.c. · 9f8afa72
      Pedro Alves authored
      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.
      9f8afa72
    • Pedro Alves's avatar
      -Wpointer-sign: ada-lang.c, ada-tasks.c. · c714b426
      Pedro Alves authored
      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.
      c714b426
    • Pedro Alves's avatar
      -Wpointer-sign: dwarf2-frame.c: Pass unsigned variable to safe_read_uleb128. · 507a579c
      Pedro Alves authored
      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.
      507a579c
    • Pedro Alves's avatar
      -Wpointer-sign: dwarf2read.c. · f9d83a0b
      Pedro Alves authored
      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 *'.
      f9d83a0b
    • Pedro Alves's avatar
      -Wpointer-sign: xcoffread.c. · 745eb4fd
      Pedro Alves authored
      ../../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 *'.
      745eb4fd
    • Pedro Alves's avatar
      -Wpointer-sign: coff-pe-read.c: treat strings in PE/COFF data as char *. · db5be46f
      Pedro Alves authored
      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.
      db5be46f
    • Pedro Alves's avatar
      -Wpointer-sign: bookmarks. · 0f928d68
      Pedro Alves authored
      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 *.
      0f928d68
    • Pedro Alves's avatar
      -Wpointer-sign: python/. · 89f6d837
      Pedro Alves authored
      This fixes -Wpointer-sign warnings in the python/ code in the manner
      that seems most appropriate to me.
      
      gdb/
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* python/py-inferior.c (infpy_write_memory): Add cast to gdb_byte
      	* python/py-prettyprint.c (print_string_repr): Change type of
      	'output' local to char *.  Add cast to gdb_byte * in
      	LA_PRINT_STRING call.
      	(print_children): Change type of 'output' local to char *.
      	* python/py-value.c (valpy_string): Add cast to const char * in
      	PyUnicode_Decode call.
      89f6d837
    • Pedro Alves's avatar
      -Wpointer-sign: remote-mips.c. · ce6ec7d8
      Pedro Alves authored
      remote-mips.c has a bunch of -Wpointer-sign warnings:
      
      ../../src/gdb/remote-mips.c: In function ‘mips_receive_packet’:
      ../../src/gdb/remote-mips.c:1128:7: error: pointer targets in passing argument 2 of ‘mips_cksum’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:830:1: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
      ../../src/gdb/remote-mips.c:1135:7: error: pointer targets in passing argument 2 of ‘mips_cksum’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:830:1: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
      ../../src/gdb/remote-mips.c: In function ‘mips_load_srec’:
      ../../src/gdb/remote-mips.c:2830:12: error: pointer targets in passing argument 4 of ‘mips_make_srec’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:134:12: note: expected ‘unsigned char *’ but argument is of type ‘char *’
      ../../src/gdb/remote-mips.c: In function ‘pmon_zeroset’:
      ../../src/gdb/remote-mips.c:3030:3: error: pointer targets in passing argument 4 of ‘pmon_makeb64’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:2977:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c: In function ‘pmon_make_fastrec’:
      ../../src/gdb/remote-mips.c:3124:6: error: pointer targets in passing argument 3 of ‘pmon_zeroset’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:3025:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c:3126:4: error: pointer targets in passing argument 4 of ‘pmon_makeb64’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:2977:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c:3148:3: error: pointer targets in passing argument 3 of ‘pmon_zeroset’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:3025:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c:3153:3: error: pointer targets in passing argument 3 of ‘pmon_zeroset’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:3025:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c:3154:8: error: pointer targets in passing argument 4 of ‘pmon_makeb64’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:2977:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c: In function ‘pmon_load_fast’:
      ../../src/gdb/remote-mips.c:3423:2: error: pointer targets in passing argument 4 of ‘pmon_makeb64’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:2977:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c:3457:4: error: pointer targets in passing argument 3 of ‘pmon_checkset’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:3051:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c:3484:8: error: pointer targets in passing argument 3 of ‘pmon_zeroset’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:3025:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/remote-mips.c:3489:3: error: pointer targets in passing argument 3 of ‘pmon_checkset’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/remote-mips.c:3051:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      
      The mips packet payload is ASCII, so it makes sense for
      mips_send_packet and mips_receive_packet to expose 'char *'-based
      interfaces, as currently they do.  But, mips packets have a binary
      header, so if you look at e.g., mips_receive_packet's implementation,
      you'll see "unsigned char" buffers in use.  I find it the most natural
      to make the payload pointer passed to mips_cksum 'char *' too.
      
      The other changes are straightforward adjustments -- a checksum is
      naturally unsigned, and there's one point where we're reading a bfd section.
      
      gdb/
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* remote-mips.c (mips_cksum): Rename 'data' parameter to 'datastr'
      	and change its type to 'const char *'.  Adjust.
      	(mips_send_packet): Add cast to 'char *', and remove cast to
      	'unsigned char *'.
      	(mips_receive_packet): Remove cast to 'unsigned char *'.
      	(mips_load_srec): Use bfd_byte.
      	(pmon_makeb64, pmon_zeroset): Make 'chksum' parameter unsigned.
      	(pmon_checkset): Make 'value' parameter unsigned.
      ce6ec7d8
    • Pedro Alves's avatar
      gdb_byte for binary buffer, char for string: common/agent.c. · fda0389f
      Pedro Alves authored
      Similarly to the remote code, agent commands are mostly ascii.  Cast to
      gdb_byte when treating the command buffer as raw memory bytes.
      
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* common/agent.c (agent_run_command): Add cast to gdb_byte *.
      fda0389f
    • Pedro Alves's avatar
      gdb_byte for binary buffer, char for string: remote.c, tracepoint.c. · bc20a4af
      Pedro Alves authored
      While the RSP is largely ASCII based (hence the packet buffer type is
      char *), at places we pass around 8-bit binary packets in that buffer.
      Functions like hex2bin or remote_escape_output conceptually are
      handling binary buffers, so I left them as working with gdb_byte, and
      added casts where necessary.  Whether these are host bytes or target
      bytes is blurry at present, so this is largely a matter of taste.
      Switching some of these functions to take "char *" or "void *" would
      be equally good.
      
      gdb/
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* remote.c (remote_write_bytes_aux, compare_sections_command)
      	(remote_read_qxfer)
      	(remote_search_memory, remote_hostio_pwrite, remote_hostio_pread)
      	(remote_hostio_readlink, remote_bfd_iovec_pread)
      	(remote_set_trace_notes): Use gdb_byte when RSP buffer is used as
      	binary buffer, and char when buffer is used as string.
      	* tracepoint.c (encode_source_string, tfile_write_uploaded_tp)
      	(trace_save, tfile_open, traceframe_walk_blocks)
      	(tfile_fetch_registers): Likewise.
      bc20a4af
    • Pedro Alves's avatar
      serial_write: change prototype to take a void-pointer buffer. · c628b528
      Pedro Alves authored
      While remote.c works with "char *" buffers most of the time, other
      remote targets have binary-ish-er protocols, and choose to use
      "unsigned char" throughout, like e.g., remote-mips.c or
      remote-m32r-sdi.c.  That results in -Wpointer-sign warnings in those
      targets, unless we add casts in calls to serial_write.  Since
      serial_write is only concerned about sending raw host bytes out, and
      serial_ops->write_prim already works with "void *"/"size_t", a similar
      interface to the "write" or "send" system calls, I find it natural to
      change serial_write's prototype accordingly, avoiding the need for
      casts.
      
      Tested on x86_64 Fedora 17, and also by building x86_64-mingw32
      and DJGPP/go32 -hosted gdbs.
      
      gdb/
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* ser-base.c (ser_base_write): Change prototype -- take 'void *'
      	buffer and size_t size.  Adjust.
      	* ser-base.h (ser_base_write): Adjust.
      	* ser-go32.c (cnts): Change type to size_t.
      	(dos_write): Change prototype -- take 'void *'
      	buffer and size_t size.  Adjust.
      	(dos_info): Print elements of 'cnts' as unsigned long.
      	* serial.c (serial_write): Likewise.
      	* serial.h (serial_write): Adjust.
      	(struct serial_ops) <write>: Change prototype -- take 'void *'
      	buffer and size_t size.  Adjust.
      c628b528
    • Pedro Alves's avatar
      Cast result of obstack_base to gdb_byte * in a couple spots. · 51a5cd90
      Pedro Alves authored
      obstack_base returns char *.  Need to cast to gdb_byte * in a couple spots.
      
      gdb/
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* c-lang.c (evaluate_subexp_c): Cast result of obstack_base to
      	gdb_byte *.
      	* linux-tdep.c (linux_make_mappings_corefile_notes): Likewise.
      51a5cd90
    • Pedro Alves's avatar
      -Wpointer-sign: alpha-tdep.c. · a9933661
      Pedro Alves authored
      ../../src/gdb/alpha-tdep.c: In function ‘alpha_extract_return_value’:
      ../../src/gdb/alpha-tdep.c:520:4: error: pointer targets in passing argument 3 of ‘regcache_cooked_read_signed’ differ in signedness [-Werror=pointer-sign]
      In file included from ../../src/gdb/alpha-tdep.c:36:0:
      
      We use regcache_cooked_read_unsigned everywhere else too.
      
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* alpha-tdep.c (alpha_extract_return_value): Use
      	regcache_cooked_read_unsigned to read 'v0'.
      a9933661
    • Pedro Alves's avatar
      -Wpointer-sign: xtensa-tdep.c. · 19afdd07
      Pedro Alves authored
      ../../src/gdb/xtensa-tdep.c:2914:4: error: pointer targets in passing argument 7 of ‘xtensa_operand_get_field’ differ in signedness [-Werror=pointer-sign]
      In file included from ../../src/gdb/xtensa-tdep.c:53:0:
      ../../src/gdb/../include/xtensa-isa.h:487:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
      ../../src/gdb/xtensa-tdep.c:2916:4: error: pointer targets in passing argument 4 of ‘xtensa_operand_decode’ differ in signedness [-Werror=pointer-sign]
      In file included from ../../src/gdb/xtensa-tdep.c:53:0:
      ../../src/gdb/../include/xtensa-isa.h:507:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
      ../../src/gdb/xtensa-tdep.c:2918:4: error: pointer targets in passing argument 7 of ‘xtensa_operand_get_field’ differ in signedness [-Werror=pointer-sign]
      In file included from ../../src/gdb/xtensa-tdep.c:53:0:
      ../../src/gdb/../include/xtensa-isa.h:487:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
      ../../src/gdb/xtensa-tdep.c:2920:4: error: pointer targets in passing argument 4 of ‘xtensa_operand_decode’ differ in signedness [-Werror=pointer-sign]
      In file included from ../../src/gdb/xtensa-tdep.c:53:0:
      ../../src/gdb/../include/xtensa-isa.h:507:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
      ../../src/gdb/xtensa-tdep.c:2922:4: error: pointer targets in passing argument 7 of ‘xtensa_operand_get_field’ differ in signedness [-Werror=pointer-sign]
      In file included from ../../src/gdb/xtensa-tdep.c:53:0:
      ../../src/gdb/../include/xtensa-isa.h:487:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
      ../../src/gdb/xtensa-tdep.c:2924:4: error: pointer targets in passing argument 4 of ‘xtensa_operand_decode’ differ in signedness [-Werror=pointer-sign]
      In file included from ../../src/gdb/xtensa-tdep.c:53:0:
      ../../src/gdb/../include/xtensa-isa.h:507:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
      
      Those bfd functions that decode instructions output uint32_t values.
      Hence this fix:
      
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* xtensa-tdep.c (execute_l32e, execute_s32e): Change type of
      	parameters 'at', 'as' and 'offset' to uint32_t.
      19afdd07
    • Pedro Alves's avatar
      -Wpointer-sign: aarch64-tdep.c. · 96b32e50
      Pedro Alves authored
      ../../src/gdb/aarch64-tdep.c: In function ‘aarch64_analyze_prologue’:
      ../../src/gdb/aarch64-tdep.c:713:7: error: pointer targets in passing argument 3 of ‘decode_cb’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/aarch64-tdep.c:386:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      ../../src/gdb/aarch64-tdep.c:747:7: error: pointer targets in passing argument 3 of ‘decode_stur’ differ in signedness [-Werror=pointer-sign]
      ../../src/gdb/aarch64-tdep.c:597:1: note: expected ‘int *’ but argument is of type ‘unsigned int *’
      
      
      'is64' is just used as a boolean; signed/unsigned doesn't really matter.
      
      2013-04-19  Pedro Alves  <palves@redhat.com>
      
      	* aarch64-tdep.c (aarch64_analyze_prologue): Change type of local
      	'is64' to signed 'int'.
      96b32e50