Commit Graph

32499 Commits

Author SHA1 Message Date
Jan Kratochvil dc90b24d1b gdb/
* cleanups.c (restore_my_cleanups): New gdb_assert for SENTINEL_CLEANUP.
2013-05-05 16:56:07 +00:00
Jan Kratochvil faab992242 gdb/
* event-top.c (display_gdb_prompt): Call missing do_cleanups.
	* infcmd.c (get_return_value) <!stop_regs>: Do not overwrite CLEANUP.
	* symfile.c (symfile_bfd_open): New variable back_to.  Do not leave
	a stale cleanup.  Fix double free of NAME.
2013-05-05 16:54:26 +00:00
gdbadmin c307590a7c *** empty log message *** 2013-05-05 00:00:03 +00:00
Eli Zaretskii e0ea48a0d7 Announce thread death on MS-Windows.
* windows-nat.c (windows_delete_thread): Accept an additional
	argument, the thread's exit code, and announce thread death when
	print_thread_events is non-zero and we are deleting a thread that
	is not the main thread.
	(get_windows_debug_event): Pass thread exit code to
	windows_delete_thread.
2013-05-04 13:36:18 +00:00
Kevin Buettner 83b2706ad5 * v850-tdep.c (elf-bfd.h, elf/v850.h): Include.
(R_149_REGNUM, E_NUM_OF_V850E2_REGS, E_SELID_1_R0_REGNUM)
	(E_SELID_1_R31_REGNUM, E_SELID_2_R0_REGNUM, E_SELID_2_R31_REGNUM)
	(E_SELID_3_R0_REGNUM, E_SELID_3_R31_REGNUM, E_SELID_4_R0_REGNUM)
	(E_SELID_4_R31_REGNUM, E_SELID_5_R0_REGNUM, E_SELID_5_R31_REGNUM)
	(E_SELID_6_R0_REGNUM, E_SELID_6_R31_REGNUM, E_SELID_7_R0_REGNUM, E_SELID_7_R31_REGNUM)
	(E_VR0_REGNUM, E_VR31_REGNUM, E_NUM_OF_V850E3V5_REGS): Define.
	(v850_abi, V850_ABI_GCC, V850_ABI_RH850): New enum and constants.
	(gdbarch_tdep): New struct.
	(v850e2_register_name): Use E_NUM_OF_V850E2_REGS instead of
	E_NUM_REGS.
	(v850e3v5_register_name): New function.
	(v850_register_type): v850e3v5 vector registers are 64-bits wide.
	(v850_use_struct_convention): Add `gdbarch' parameter.  Add new
	code handling the struct return conventions for the RH850 ABI.
	Update all callers.
	(v850_eight_byte_align_p): New function.
	(v850_push_call_dummy): Push structs by value, not by reference
	for the RH850 ABI.  Add support for eight byte alignment.
	(v850_dbtrap_breakpoint_from_pc): New function.
	(v850_gdbarch_init): Add ABI detection code.  Register
	v850e3v5_register_name for the v850e3v5 architecture.  Set the
	number of registers for v850e3v5.  Register
	v850_dbtrap_breakpoint_from_pc as appropriate.
	(_initialize_gdbarch_init): Registration bfd_arch_v850_rh850.
2013-05-04 06:25:20 +00:00
Doug Evans d445b2f6a4 * objfiles.c (objfile_relocate): Use gdb_bfd_count_sections instead
of bfd_count_sections.
	* solib-target.c (solib_target_relocate_section_addresses): Ditto.
	* symfile.c (default_symfile_offsets): Ditto.
	(syms_from_objfile_1): Ditto.  Make dummy addrs list an array of
	one entry, not bfd_count_sections entries.
2013-05-04 06:19:31 +00:00
Kevin Buettner b3ce41ea47 * rl78-tdep.c (rl78_register_reggroup_p): Include SP in the
`save' and `restore' register groups.  Don't include SPL
	or SPH in these groups.
	(rl78_dwarf_reg_to_regnum):  Adjust mapping for
	RL78_PC_REGNUM.  Add mappings for RL78_PSW_REGNUM,
	RL78_ES_REGNUM, and RL78_CS_REGNUM.
	(rl78_gdbarch_init): Set `dwarf2_addr_size' to 4.  Invoke
	dwarf2_append_unwinders().
2013-05-04 06:14:53 +00:00
gdbadmin c154501950 *** empty log message *** 2013-05-04 00:00:02 +00:00
Philippe Waroquiers 96f7d3f166 Fix to handle properly 'catch signal SIGINT' and SIGTRAP 2013-05-03 19:16:56 +00:00
Hafiz Abid Qadeer 1ebff1fdfd 2013-05-03 Hafiz Abid Qadeer <abidh@codesourcery.com>
* tracepoint.c (cmd_qtinit): Call 'stop_tracing'.

2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>

	* status-stop.exp (test_tstart_tstart): Check for error
	returned by the second 'tstart' command.
2013-05-03 15:43:58 +00:00
gdbadmin 5b34ca8af7 *** empty log message *** 2013-05-03 00:00:03 +00:00
gdbadmin 1e456ce018 *** empty log message *** 2013-05-02 00:00:33 +00:00
Joel Brobecker b9dd19477d Fix various -Wpointer-sign warnings in darwin-nat.c
gdb/ChangeLog:

        * darwin-nat.c (darwin_read_write_inferior): Change types
        of parameters rdaddr and wraddr to "gdb_byte *". Change type
        of copy_count to "mach_msg_type_number_t".
        (darwin_read_dyld_info): Change type of parameter
        rdaddr to "gdb_byte *".
2013-05-01 14:54:18 +00:00
Joel Brobecker 4ca18a63a8 Fix -Wpointer-sign errors in solib-ia64-hpux.c
gdb/ChangeLog:

        * solib-ia64-hpux.c (ia64_hpux_read_dynamic_info): Change cast
        of &info->load_map from "char *" to "gdb_byte *".
2013-05-01 14:33:00 +00:00
Joel Brobecker 2b692d328b Fix -Wpointer-sign errors in ia64-tdep.c
gdb/ChangeLog:

        * ia64-tdep.c (ia64_access_fpreg): Change cast of val
        from "char *" to "gdb_byte *".
        (ia64_access_rse_fpreg, ia64_access_mem): Likewise.
2013-05-01 14:31:55 +00:00
gdbadmin a976710f0d *** empty log message *** 2013-05-01 00:00:02 +00:00
Doug Evans 6a506a2dcb * dwarf2read.c (lookup_dwo_unit): Return NULL if DWO not found.
(init_cutu_and_read_dies): Flag a complaint, not error, for bad
	DWO stub.  If DWO isn't found, just use stub.
	(lookup_dwo_cutu): Don't try DWO if there's a DWP file.
2013-04-30 23:19:41 +00:00
Doug Evans a98c29a089 * dwarf2read.c (dw2_find_symbol_file): Initialize filename before
calling init_cutu_and_read_dies.
2013-04-30 21:11:50 +00:00
Walfred Tedeschi f92b06daf9 Fix display of structures/bitfields in register description.
Add support for displaying structures and bitfields for registers when
executing "maint print c-tdesc". This command is also used when
converting the xml target description file into c file.

Example of the behaviour is given below reporting a snipet of the xml file
and a snippet of the c code generated.

XML file contains:
...
    <union id="vecint">
      <field name="v4" type="v4int8"/>
      <field name="v2" type="v2int16"/>
    </union>

    <struct id="struct1">
      <field name="v4" type="v4int8"/>
      <field name="v2" type="v2int16"/>
    </struct>

    <struct id="struct2" size="8">
      <field name="f1" start="0" end="34"/>
      <field name="f2" start="63" end="63"/>
    </struct>
...

Setting this xml file as target description file and
issuing the maintenance print c-tdesc the following output
is obtained:

  feature = tdesc_create_feature (result, "extra");
  field_type = tdesc_named_type (feature, "int8");
  tdesc_create_vector (feature, "v4int8", field_type, 4);

  field_type = tdesc_named_type (feature, "int16");
  tdesc_create_vector (feature, "v2int16", field_type, 2);

  type = tdesc_create_union (feature, "vecint");
  field_type = tdesc_named_type (feature, "v4int8");
  tdesc_add_field (type, "v4", field_type);
  field_type = tdesc_named_type (feature, "v2int16");
  tdesc_add_field (type, "v2", field_type);

C output is not supported type "struct1".

This is finally the issue.

2013-03-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>

        * target-descriptions.c (maint_print_c_tdesc_cmd):
        Add case to parse structures as register types and
        bitfields.

testsuite/

	* gdb.xml/maint_print_struct.exp: New file.
	* gdb.xml/maint_print_struct.xml: New file.

Change-Id: I2e20b095d508319c80275e724a9452c7e2834067
Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2013-04-30 12:33:52 +00:00
Joel Brobecker f1d02dd44d Fix date in some of my recent ChangeLog entries... 2013-04-30 11:56:23 +00:00
Joel Brobecker 019c1128ac Fix -Wpointer-sign warning in sol-thread.c
This fixes a couple of compiler warnings in rw_common when calling
target_read_memory/target_write_memory due to the type of parameter
"buf" (char *) not matching what these function expect (gdb_byte *).

gdb/ChangeLog:

        * sol-thread.c (rw_common): Change type of parameter "buf"
        to "gdb_byte *".
        (ps_pdwrite, ps_ptwrite): Cast parameter "buf" in call to
        rw_common to "gdb_byte *" instead of "char *".
2013-04-30 11:52:13 +00:00
Joel Brobecker 5812197ca1 Fix build error in sol-thread.c:info_cb
gdb/ChangeLog:

        * sol-thread.c (info_cb) [ti.ti_startfunc != 0]: Change type
        of local variable msym to const struct bound_minimal_symbol.
        Adjust use accordingly.
        [ti.ti_state == TD_THR_SLEEP]: Likewise.
2013-04-30 11:36:45 +00:00
Walfred Tedeschi 95eebdcc1f Add myself as a maintainer.
Change-Id: Ie1b0cb082a384144eef327e9294949e9bacc4415
2013-04-30 11:17:20 +00:00
Thomas Schwinge ecccb8133f 2013-04-30 Samuel Thibault <samuel.thibault@gnu.org>
* i386gnu-nat.c (CREG_OFFSET): New macro.
	(creg_offset): New array.
	(CREG_ADDR): Use creg_offset instead of reg_offset.
2013-04-30 09:27:43 +00:00
Joel Brobecker 54746424da mep: define gdbarch_pc_regnum instead of gdbarch_write_pc.
gdb/ChangeLog:

    * mep-tdep.c (mep_write_pc): Delete.
    (mep_gdbarch_init): Remove call to set_gdbarch_write_pc.
    Add call to set_gdbarch_pc_regnum.
2013-04-30 08:28:54 +00:00
Joel Brobecker ee35f36cec Delete ChangeLog entry with no corresponding change in sources.
This ChangeLog entry was the result of a result of botched commit
which resulted in the ChangeLog update being checked in, while
the actual code code itself did not make it to CVS.

This patch deletes the entry in gdb/ChangeLog titled:

    mep: define gdbarch_pc_regnum instead of gdbarch_write_pc.
2013-04-30 08:28:31 +00:00
Joel Brobecker 01da98f9f4 filestuff.c: Include "gdb_dirent.h" instead of <dirent.h>
gdb/ChangeLog:

        * common/filestuff.c: Replace #include <dirent.h> by
        #include "gdb_dirent.h".
2013-04-30 08:20:47 +00:00
Joel Brobecker 366c6766d8 filestuff.c: Use gdb_stat.h instead of <sys/stat.h>
gdb/ChangeLog:

        * common/filestuff.c: Replace #include <sys/stat.h> by
        #include "gdb_stat.h".
2013-04-30 08:20:04 +00:00
gdbadmin 013519f747 *** empty log message *** 2013-04-30 00:00:02 +00:00
Tom Tromey 3f84184e8b PR python/14204:
* gdb.texinfo (Python API): Fix menu entry.
	(Blocks In Python): Fix subsubsection text.  Rewrite intro.
	Define global and static block.  Add example.  Clarify
	block relationship for inline functions.
2013-04-29 17:32:43 +00:00
Tom Tromey 6015523492 * gdb.texinfo (Python API): Mention Python help and keyword
arguments.  Move pagination text to Basic Python.
	(Basic Python): Put pagination text here.  Document
	close-on-exec, SIGCHLD, and SIGINT.
2013-04-29 17:30:26 +00:00
Joel Brobecker 09526ec1c2 mep: define gdbarch_pc_regnum instead of gdbarch_write_pc.
gdb/ChangeLog:

	* mep-tdep.c (mep_write_pc): Delete.
	(mep_gdbarch_init): Remove call to set_gdbarch_write_pc.
	Add call to set_gdbarch_pc_regnum.
2013-04-29 10:10:35 +00:00
Joel Brobecker d27b54adf3 Use gdbarch_pc_regnum instead of gdbarch_write_pc.
gdb/ChangeLog:

	* m32r-tdep.c (m32r_write_pc): Delete.
	(m32r_gdbarch_init): Remove call to set_gdbarch_write_pc.
	Add call to set_gdbarch_pc_regnum.
2013-04-29 10:08:46 +00:00
Pierre Muller b385a60dc4 * dwarf2read.c (handle_DW_AT_stmt_list): Avoid ARI warning for
editCase function rule.
	(get_DW_AT_signature_type): Likewise.
2013-04-29 09:52:07 +00:00
Pierre Muller 47d21dc520 * ./contrib/ari/gdb_ari.sh (editCase rule): Fix spelling error. 2013-04-29 08:32:18 +00:00
Joel Brobecker 9056882e81 Add ARI marker to get_DW_AT_signature_type.
gdb/ChangeLog:

        * dwarf2read.c (get_DW_AT_signature_type): Add ARI marker.
2013-04-29 05:05:44 +00:00
gdbadmin 358d1d6030 *** empty log message *** 2013-04-29 00:00:02 +00:00
Yao Qi 7ee4732a0c gdb/
* solib-dsbt.c (fetch_loadmap): Re-indent.
	(displacement_from_map, enable_break2): Likewise.
	(dsbt_relocate_section_addresses): Likewise.
2013-04-28 08:58:29 +00:00
gdbadmin 3d80fd16c5 *** empty log message *** 2013-04-28 00:00:02 +00:00
gdbadmin 6c6b70567b *** empty log message *** 2013-04-27 00:00:32 +00:00
gdbadmin 2260af53be GDB 7.6 released. 2013-04-26 14:07:53 +00:00
gdbadmin 7f5039149d *** empty log message *** 2013-04-26 00:00:02 +00:00
Tom Tromey ff54693587 PR corefiles/14983:
* dwarf2read.c (process_full_comp_unit): Always create a static
	block.
gdb/testsuite
	* gdb.dwarf2/nostaticblock.exp: New file.
2013-04-25 16:25:37 +00:00
Hui Zhu c65e009ff7 Fix format error of ChangeLog. 2013-04-25 08:03:31 +00:00
Hui Zhu f6150862d2 2013-04-25 Hui Zhu <hui@codesourcery.com>
PR gdb/15186

	* ax.c (ax_printf): Add fflush.
2013-04-25 02:58:05 +00:00
gdbadmin 320395c55a *** empty log message *** 2013-04-25 00:00:32 +00:00
Hui Zhu 40fb6c5ead 2013-04-25 Hui Zhu <hui@codesourcery.com>
* breakpoint.c (build_target_command_list): Change loc->cond_bytecode
	to loc->cmd_bytecode.
2013-04-24 23:09:31 +00:00
Doug Evans 74e04d1ccf * dwarf2read.c (setup_type_unit_groups): Fix comment. 2013-04-24 19:12:26 +00:00
Keith Seitz 3cf62c1d5c * tracepoint.c (trace_save): Call the writer's start method. 2013-04-24 18:22:31 +00:00
Muhammad Bilal bf9e4d0c1f 2013-04-24 Muhammad Bilal <mbilal@codesourcery.com>
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.
2013-04-24 14:29:17 +00:00
gdbadmin 901d9a9160 *** empty log message *** 2013-04-24 00:00:32 +00:00
Tom Tromey 5d71132c29 * common/filestuff.c: Check USE_WIN32API before including
sys/socket.h.
	(HAVE_F_GETFD): New define.
	(mark_cloexec): Check HAVE_F_GETFD.
	(gdb_open_cloexec): Change 'mode' to unsigned long.
	(gdb_socketpair_cloexec): Check HAVE_SOCKETPAIR.
	(gdb_pipe_cloexec): Check HAVE_PIPE.
	* common/filestuff.h (gdb_open_cloexec): Change 'mode' to unsigned
	long.
2013-04-23 15:49:25 +00:00
Hui Zhu a11cfd87c0 2013-04-23 Hui Zhu <hui@codesourcery.com>
PR gdb/15293

	* breakpoint.c (bpstat_what): Add BPSTAT_WHAT_SINGLE to bp_dprintf.

2013-04-23  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15293

	* gdb.base/dprintf.exp: Add ignore command.
2013-04-23 03:20:21 +00:00
Hui Zhu 2d9442cc40 2013-04-23 Hui Zhu <hui@codesourcery.com>
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.
2013-04-23 02:42:44 +00:00
gdbadmin 4986ea1b42 *** empty log message *** 2013-04-23 00:00:02 +00:00
Tom Tromey 0f3305ed70 * gdb.gdb/selftest.exp (do_steps_and_nexts): Check for
notice_open_fds.
2013-04-22 20:18:23 +00:00
Tom Tromey 614c279dda PR gdb/7912:
* 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.
2013-04-22 16:46:15 +00:00
Edjunior Barbosa Machado 5fda2332f3 2013-04-22 Edjunior Machado <emachado@linux.vnet.ibm.com>
* 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'.
2013-04-22 15:50:57 +00:00
Yao Qi eb6c553bd4 gdb/
* infrun.c: Fix typo in comment.
2013-04-22 09:34:27 +00:00
Sergio Durigan Junior d504301e64 2013-04-22 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.arch/arm-bl-branch-dest.exp: Replace additional_flags by
	ldflags.
2013-04-22 09:32:21 +00:00
Sergio Durigan Junior 9991b20795 Andrew Haley found a bug on GDB running on ARM when using
--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.
2013-04-22 09:20:33 +00:00
gdbadmin 1f81bca148 *** empty log message *** 2013-04-22 00:00:32 +00:00
gdbadmin e365947e94 *** empty log message *** 2013-04-21 00:00:32 +00:00
Yao Qi 8b4833e358 gdb/
* 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 *'.
2013-04-20 07:38:39 +00:00
gdbadmin 67b8da8244 *** empty log message *** 2013-04-20 00:00:32 +00:00
Pedro Alves 5360976e5a s/signness/signedness in gdbint.texinfo.
"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".
2013-04-19 18:41:32 +00:00
Pedro Alves bd3f3b5535 Enable -Wpointer-sign by default.
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.
2013-04-19 18:32:54 +00:00
Pedro Alves c49e7f76af Make GDB -Wpointer-sign clean on MinGW too.
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 *'.
2013-04-19 17:48:10 +00:00
Pedro Alves 12ff8552b9 -Wpointer-sign: monitor.c.
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.
2013-04-19 17:44:18 +00:00
Pedro Alves 9c37696b24 -Wpointer-sign: record.c.
../../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.
2013-04-19 15:37:31 +00:00
Pedro Alves a398505b40 -Wpointer-sign: ctf.c.
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 *'.
2013-04-19 15:36:52 +00:00
Pedro Alves 9f8afa72d1 -Wpointer-sign: cp-valprint.c.
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.
2013-04-19 15:36:24 +00:00
Pedro Alves c714b42695 -Wpointer-sign: ada-lang.c, ada-tasks.c.
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.
2013-04-19 15:35:58 +00:00
Pedro Alves 507a579c9a -Wpointer-sign: dwarf2-frame.c: Pass unsigned variable to safe_read_uleb128.
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.
2013-04-19 15:35:21 +00:00
Pedro Alves f9d83a0bd6 -Wpointer-sign: dwarf2read.c.
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 *'.
2013-04-19 15:34:46 +00:00
Pedro Alves 745eb4fdb2 -Wpointer-sign: xcoffread.c.
../../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 *'.
2013-04-19 15:33:58 +00:00
Pedro Alves db5be46fdc -Wpointer-sign: coff-pe-read.c: treat strings in PE/COFF data as 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.
2013-04-19 15:33:29 +00:00
Pedro Alves 0f928d685b -Wpointer-sign: bookmarks.
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 *.
2013-04-19 15:32:56 +00:00
Pedro Alves 89f6d8377b -Wpointer-sign: python/.
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.
2013-04-19 15:29:09 +00:00
Pedro Alves ce6ec7d8d0 -Wpointer-sign: remote-mips.c.
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.
2013-04-19 15:28:42 +00:00
Pedro Alves fda0389f6a gdb_byte for binary buffer, char for string: common/agent.c.
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 *.
2013-04-19 15:27:54 +00:00
Pedro Alves bc20a4afc3 gdb_byte for binary buffer, char for string: remote.c, tracepoint.c.
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.
2013-04-19 15:27:06 +00:00
Pedro Alves c628b528e0 serial_write: change prototype to take a void-pointer buffer.
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.
2013-04-19 15:26:17 +00:00
Pedro Alves 51a5cd9059 Cast result of obstack_base to gdb_byte * in a couple spots.
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.
2013-04-19 15:24:55 +00:00
Pedro Alves a993366103 -Wpointer-sign: alpha-tdep.c.
../../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'.
2013-04-19 15:24:25 +00:00
Pedro Alves 19afdd0748 -Wpointer-sign: xtensa-tdep.c.
../../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.
2013-04-19 15:23:52 +00:00
Pedro Alves 96b32e50dd -Wpointer-sign: aarch64-tdep.c.
../../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'.
2013-04-19 15:23:18 +00:00
Pedro Alves eb1bd1fb4b -Wpointer-sign: s390-tdep.c.
-Wpointer-sign reveals a bunch of:

../../src/gdb/s390-tdep.c:1342:7: error: pointer targets in passing argument 4 of ‘is_rx’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1038:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1343:9: error: pointer targets in passing argument 5 of ‘is_rxy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1055:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1344:9: error: pointer targets in passing argument 5 of ‘is_rxy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:1055:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
...
../../src/gdb/s390-tdep.c:1363:7: error: pointer targets in passing argument 5 of ‘is_rs’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:966:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1364:9: error: pointer targets in passing argument 6 of ‘is_rsy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:983:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
../../src/gdb/s390-tdep.c:1365:9: error: pointer targets in passing argument 6 of ‘is_rsy’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/s390-tdep.c:983:1: note: expected ‘unsigned int *’ but argument is of type ‘int *’
...

I don't know much about s390, but from reading the code I believe the
right fix is to treat d2 as signed.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* s390-tdep.c (is_rs, is_rsy, is_rx, is_rxy): Change type of 'd2'
	parameter to int *.
2013-04-19 15:22:47 +00:00
Pedro Alves 463920bf28 ppc-linux-tdep.c: Wrong signness for buffer holding instructions.
There seems to be no reason for this buffer to be signed.  We pass it
around to functions expecting it to be unsigned (which triggers
-Wpointer-sign warnings).

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* ppc-linux-tdep.c (ppc_skip_trampoline_code): Change local
	'insnbuf' buffer type to unsigned int[].
2013-04-19 15:22:14 +00:00
Pedro Alves 70242eb16c mips-tdep.c: Wrong signness for local holding PC register.
Addresses on MIPS are signed, and we're indeed using
regcache_cooked_read_signed to read the PC, but, we're passing it the
address of an unsigned variable, which triggers a -Wpointer-sign
warning.  I've chosen to change the variable's type.  I believe this
will end up being the same (though I can't test it).

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* mips-tdep.c (mips_read_pc): Change local 'pc' type to LONGEST.
2013-04-19 15:21:24 +00:00
Pedro Alves 9d1dd0e275 mep-tdep.c: Wrong signness for instruction buffer.
There seems to be no reason for this to be signed.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* mep-tdep.c (mep_get_insn): Change 'insn' parameter type to
	unsigned long *.
2013-04-19 15:15:55 +00:00
Pedro Alves 44096aee2e alpha-tdep.c/mips-tdep.c: "set heuristic-fence-post" is signed/zinteger.
These commands are currently var_zinteger, hence their control
variable is signed.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* alpha-tdep.c (heuristic_fence_post): Change type to int.
	(alpha_heuristic_proc_start): Adjust to check -1 instead of
	UINT_MAX.
	* mips-tdep.c (heuristic_fence_post): Change type to int.
	(heuristic_proc_start): Adjust to check -1 instead of UINT_MAX.
2013-04-19 15:15:21 +00:00
Pedro Alves e4286e57c5 cris-tdep.c: Use unsigned variable for unsigned command.
"set cris-version" is an unsigned command:

    /* CRIS-specific user-commands.  */
    add_setshow_uinteger_cmd ("cris-version", class_support,
  			    &usr_cmd_cris_version,
  			    _("Set the current CRIS version."),
  			    _("Show the current CRIS version."),
  			    _("\
  Set to 10 for CRISv10 or 32 for CRISv32 if autodetection fails.\n\
  Defaults to 10. "),

Tested by building on x86_64 Fedora 17.

2013-04-19  Pedro Alves  <palves@redhat.com>

	* cris-tdep.c (usr_cmd_cris_version): Make unsigned.
	(struct gdbarch_tdep) <cris_version>: Make unsigned.
	(cris_spec_reg_applicable, cris_gdbarch_init): Adjust locals.
2013-04-19 15:14:23 +00:00
Pedro Alves 001f13d822 -Wpointer-sign: gdb_byte -> char.
This is sort of the opposite of the previous patch.  Places that
manipulate strings or interfaces that return strings are changed to
use char* instead of gdb_byte*.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* avr-tdep.c (avr_io_reg_read_command): New local 'bufstr'.  Use
	it to get a string view of the byte buffer.
	* i386-cygwin-tdep.c (core_process_module_section): Change local 'buf'
	type to gdb_byte *.  Adjust.
	* linux-tdep.c (linux_info_proc, linux_find_memory_regions_full):
	Change local to char *.
	* solib-darwin.c (find_program_interpreter): Change return type to
	char *.  Adjust.
	(darwin_solib_get_all_image_info_addr_at_init): Adjust.
	* solib-dsbt.c (enable_break2): Change local 'buf' to char *.
	* solib-frv.c (enable_break2): Change local 'buf' to char *.
	* solib-spu.c (spu_current_sos): Add gdb_byte * cast.
	* solib-svr4.c (find_program_interpreter): Change return type to
	char *.  Adjust.
	(enable_break): Change local 'interp_name' to char *.
	* spu-multiarch.c (spu_xfer_partial): Add cast to 'char *'.
	* spu-tdep.c (spu_pseudo_register_read_spu): Add cast to 'char *'.
	(spu_pseudo_register_write_spu): Use char for string buffer.
	Adjust.
	(info_spu_event_command, info_spu_signal_command): Add casts to
	'char *'.
2013-04-19 15:10:53 +00:00
Pedro Alves 948f8e3d72 -Wpointer-sign: char -> gdb_byte.
-Wpointer-sign catches all these cases across the codebase that should
be using gdb_byte for raw target bytes.  I think these are all
obvious, hence I've collapsed into a single patch.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

	* aarch64-tdep.c (aarch64_default_breakpoint): Change type to
	gdb_byte[].
	(aarch64_breakpoint_from_pc): Change return type to gdb_byte *.
	* ada-lang.c (ada_value_assign): Use gdb_byte.
	* alphanbsd-tdep.c (sigtramp_retcode): Change type to gdb_byte[].
	(alphanbsd_sigtramp_offset): Use gdb_byte.
	* arm-linux-tdep.c (arm_linux_arm_le_breakpoint)
	(arm_linux_arm_be_breakpoint, eabi_linux_arm_le_breakpoint)
	(eabi_linux_arm_be_breakpoint, arm_linux_thumb_be_breakpoint)
	(arm_linux_thumb_le_breakpoint, arm_linux_thumb2_be_breakpoint)
	(arm_linux_thumb2_le_breakpoint): Change type to gdb_byte[].
	* arm-tdep.c (arm_stub_unwind_sniffer)
	(arm_displaced_init_closure): Use gdb_byte.
	(arm_default_arm_le_breakpoint, arm_default_arm_be_breakpoint)
	(arm_default_thumb_le_breakpoint)
	(arm_default_thumb_be_breakpoint): Change type to gdb_byte[].
	* arm-tdep.h (struct gdbarch_tdep) <arm_breakpoint,
	thumb_breakpoint, thumb2_breakpoint>: Change type to gdb_byte *.
	* arm-wince-tdep.c (arm_wince_le_breakpoint)
	(arm_wince_thumb_le_breakpoint): Change type to gdb_byte[].
	* armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint)
	(arm_nbsd_arm_be_breakpoint, arm_nbsd_thumb_le_breakpoint)
	(arm_nbsd_thumb_be_breakpoint): Change type to gdb_byte[].
	* armobsd-tdep.c (arm_obsd_thumb_le_breakpoint)
	(arm_obsd_thumb_be_breakpoint): Change type to gdb_byte[].
	* cris-tdep.c (push_stack_item, cris_push_dummy_call)
	(cris_store_return_value, cris_extract_return_value): Use
	gdb_byte.
	(constraint): Change type of parameter to char * from signed
	char*.  Use gdb_byte.
	* dwarf2loc.c (read_pieced_value, write_pieced_value): Change type
	of local buffer to gdb_byte *.
	* dwarf2read.c (read_index_from_section): Use gdb_byte.
	(create_dwp_hash_table): Change type of locals to gdb_byte *.
	(add_address_entry): Change type of local buffer to gdb_byte[].
	* frv-tdep.c (frv_adjust_breakpoint_address, find_func_descr)
	(frv_push_dummy_call): Use gdb_byte.
	* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code)
	(hppa_hpux_supply_ss_fpblock, hppa_hpux_supply_ss_wide)
	(hppa_hpux_supply_save_state): Use gdb_byte.
	* hppa-tdep.c (hppa32_push_dummy_call)
	(hppa64_convert_code_addr_to_fptr): Use gdb_byte.
	* ia64-tdep.c (extract_bit_field, replace_bit_field)
	(slotN_contents, replace_slotN_contents): Change type of parameter
	to gdb_byte *.
	(fetch_instruction, ia64_pseudo_register_write)
	(ia64_register_to_value, ia64_value_to_register)
	(ia64_extract_return_value, ia64_store_return_value)
	(ia64_push_dummy_call): Use gdb_byte.
	* m32c-tdep.c (m32c_return_value): Remove cast.
	* m68hc11-tdep.c (m68hc11_pseudo_register_write)
	(m68hc11_push_dummy_call, m68hc11_store_return_value): Use
	gdb_byte.
	* mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Use gdb_byte.
	* mn10300-tdep.c (mn10300_store_return_value)
	(mn10300_breakpoint_from_pc, mn10300_push_dummy_call): Use
	gdb_byte.
	* moxie-tdep.c (moxie_process_readu): Use gdb_byte.
	(moxie_process_record): Remove casts.
	* ppc-ravenscar-thread.c (supply_register_at_address)
	(ppc_ravenscar_generic_store_registers): Use gdb_byte.
	* ravenscar-thread.c (get_running_thread_id): Use gdb_byte.
	* remote-m32r-sdi.c (m32r_fetch_register): Use gdb_byte.
	* remote-mips.c (mips_xfer_memory): Use gdb_byte.
	* remote.c (compare_sections_command): Use gdb_byte.
	* score-tdep.c (score7_free_memblock): Change type of parameter to
	gdb_byte *.
	* sh-tdep.c (sh_justify_value_in_reg): Change return type to
	gdb_byte *.  Use gdb_byte.
	(sh_push_dummy_call_fpu): Use gdb_byte.
	(sh_extract_return_value_nofpu, sh_extract_return_value_fpu)
	(sh_store_return_value_nofpu, sh_store_return_value_fpu)
	(sh_register_convert_to_virtual, sh_register_convert_to_raw):
	Change parameter type to 'gdb_byte *'.  Use gdb_byte.
	(sh_pseudo_register_read, sh_pseudo_register_write): Use gdb_byte.
	* sh64-tdep.c (sh64_push_dummy_call): Use gdb_byte.
	(sh64_store_return_value, sh64_register_convert_to_virtual):
	Change parameter type to 'gdb_byte *'.  Use gdb_byte.
	(sh64_pseudo_register_write): Use gdb_byte.
	* solib-darwin.c (darwin_current_sos): Add casts to 'gdb_byte *'.
	* solib-irix.c (fetch_lm_info): Likewise.  Use gdb_byte for byte
	buffer.
	(irix_current_sos): Use gdb_byte.
	* solib-som.c (som_current_sos): Use gdb_byte.
	* sparc-ravenscar-thread.c (supply_register_at_address)
	(sparc_ravenscar_generic_store_registers): Use gdb_byte.
	* spu-multiarch.c (spu_xfer_partial): Add cast to 'char *'.
	* spu-tdep.c (spu_get_overlay_table): Use gdb_byte.
	* tic6x-tdep.c (tic6x_breakpoint_from_pc): Change return type to
	'gdb_byte *'.
	* tic6x-tdep.h (struct gdbarch_tdep) <breakpoint>: Change type to
	'gdb_byte *'.
	* tracepoint.c (tfile_fetch_registers): Use gdb_byte.
	* xstormy16-tdep.c (xstormy16_extract_return_value)
	(xstormy16_store_return_value): Change parameter type to
	'gdb_byte *'.  Adjust.
	(xstormy16_push_dummy_call): Use gdb_byte.
	* xtensa-tdep.c (xtensa_scan_prologue, call0_ret)
	(call0_analyze_prologue, execute_code): Use gdb_byte.
2013-04-19 15:09:46 +00:00
Pedro Alves 433730c973 Fix the x87 FP register printout when issuing the “info float” command.
Consider the following simple program:

.globl  _start
.text
_start:
      fldt    val
.data
      val: .byte 0x00,0x00,0x45,0x07,0x11,0x19,0x22,0xe9,0xfe,0xbf

With current GDB on x86-64 GNU/Linux hosts, after the moment the fldt
command has been executed the register st(0) looks like this,
according to the “info regs” output (TOP=7):

  R7: Valid   0xffffffbffffffffeffffffe922191107450000 -0.910676542908976927

which is clearly wrong (just count its length).  The problem is due to
the printf statement (see patch) printing a promoted integer value of
a char argument "raw[i]", and, since char is signed on x86-64
GNU/Linux, the erroneous “ffffff” are printed for the first three
bytes which turn out to be "negative".  The fix is to use gdb_byte
instead which is unsigned (and is the type of value_contents(), the
type to be used for raw target bytes anyway).  After the fix the value
will be printed correctly:

  R7: Valid   0xbffee922191107450000 -0.910676542908976927

gdb/
2013-04-19  Vladimir Kargov <kargov@gmail.com>
	    Pedro Alves  <palves@redhat.com>

	* i387-tdep.c (i387_print_float_info): Use gdb_byte for pointer to
	value contents.

gdb/testsuite/
2013-04-19  Vladimir Kargov  <kargov@gmail.com>
	    Pedro Alves  <palves@redhat.com>

	* gdb.arch/i386-float.S: New file.
	* gdb.arch/i386-float.exp: New file.
2013-04-19 14:13:30 +00:00
gdbadmin 19d5d8eec2 *** empty log message *** 2013-04-19 00:00:02 +00:00
Luis Machado 9a9083349d * gdb.mi/mi-var-create-rtti.exp: Create a variable of
type void *.
2013-04-18 10:08:08 +00:00
gdbadmin 886aeba7a3 *** empty log message *** 2013-04-18 00:00:32 +00:00
Doug Evans 4f22ed5cac * lib/dwarf.exp (Dwarf): New proc "tu".
* gdb.dwarf2/missing-sig-type.exp: New file.
2013-04-17 21:07:09 +00:00