aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-05-30fix cleanup handling in macho_symfile_readTom Tromey2-2/+7
macho_symfile_read leaks a cleanup by assigning to 'back_to' too late. * machoread.c (macho_symfile_read): Assign first cleanup to 'back_to'.
2013-05-30fix cleanup handling in m32r_loadTom Tromey2-0/+5
m32r_load is missing a call to do_cleanups along one return path. * m32r-rom.c (m32r_load): Call do_cleanups at all returns.
2013-05-30fix list_available_thread_groupsTom Tromey2-1/+8
list_available_thread_groups, in mi-main.c, leaks a cleanup. This changes it to call do_cleanups. * mi/mi-main.c (list_available_thread_groups): Call do_cleanups.
2013-05-30cleanup fixes for inf-ptrace.cTom Tromey2-8/+12
This is one of the stylistic patches. The code here in inf-ptrace.c is not incorrect, but it is in a style that the cleanup checker cannot handle. This patch changes it to a simpler style, following the usual method of introducing an unconditional "outer" cleanup. * inf-ptrace.c (inf_ptrace_create_inferior): Unconditionally call discard_cleanups. (inf_ptrace_attach): Likewise.
2013-05-30cleanup fixes for remote-mips.cTom Tromey2-4/+22
remote-mips.c has a few 'return's where cleanups are not run. * remote-mips.c (mips_exit_debug): Call do_cleanups on all return paths. (mips_initialize): Likewise. (common_open): Call do_cleanups.
2013-05-30fix up cleanup handling in internal_vproblemTom Tromey2-0/+6
internal_vproblem can return, so this introduces proper cleanup handling there. Otherwise it may make a cleanup that is leaked. * utils.c (internal_vproblem): Call do_cleanups.
2013-05-30fix linespec bug noticed by the checkerTom Tromey2-1/+5
This fixes a linespec bug noticed by the cleanup checker. find_linespec_symbols did this: cleanup = demangle_for_lookup (name, state->language->la_language, &lookup_name); [...] cleanup = make_cleanup (xfree, canon); But this is wrong, as it makes a subsequent call to do_cleanups not clean up all the local state. * linespec.c (find_linespec_symbols): Don't reassign to 'cleanup'.
2013-05-30remove erroneous return from setup_user_argsTom Tromey2-5/+6
This fixes setup_user_args to drop a useless and confusing "return". * cli/cli-script.c (setup_user_args): Don't return after error.
2013-05-30fix cleanups in som_symtab_readTom Tromey2-1/+8
This fixes som_symtab_read not to leak cleanups. * somread.c (som_symtab_read): Call do_cleanups.
2013-05-30fix print_command_1Tom Tromey2-6/+7
This is a stylistic patch to make it so the checker can analyze print_command_1. This amounts to installing an outer cleanup and unconditionally invoking it. * printcmd.c (print_command_1): Unconditionally call do_cleanups.
2013-05-30some cleanup checker fixesTom Tromey6-7/+40
Fix some bugs pointed out by the cleanup checker. This one just fixes some simple CLI reports, where CLI commands know that their caller will do cleanups. This an older style with few instances, so it is simpler to fix them up than to teach the checker about it. * cli/cli-cmds.c (cd_command, alias_command): Call do_cleanups. * cli/cli-dump.c (restore_binary_file): Call do_cleanups. * interps.c (interpreter_exec_cmd): Call do_cleanups. * source.c (show_substitute_path_command): Call do_cleanups. (unset_substitute_path_command, set_substitute_path_command): Likewise. * symfile.c (load_command): Call do_cleanups.
2013-05-30add the cleanup checkerTom Tromey3-1/+371
This patch adds the cleanup checker. This is a Python plugin for GCC that checks some rules for cleanup handling. In particular it tries to notice when cleanups are left dangling at the end of a function. It does this by applying a few simple rules. First, it understands that a function whose return type is "struct cleanup *" is a "cleanup constructor". Such functions are expected to return the first cleanup that they make. Then, it has the notion of a "master cleanup". The checker keeps a stack of all cleanups made in a basic block. The first element is pushed on the stack is the master cleanup -- the one that must later be passed to either do_cleanups or discard_cleanups. It is not perfect -- some constructs confuse it. So, part of this series rewrites some code in gdb so that it is analyzable. I'll note these spots and you can decide whether or not this is a good idea. This patch also changes gcc-with-excheck to give it options. Now you must use either -Xc (for the cleanup checker) or -Xx (for the exception checker). * contrib/cleanup_check.py: New file. * contrib/gcc-with-excheck: Add option parsing.
2013-05-30windows_delete_thread: Add missing space in cast expressionJoel Brobecker2-1/+6
gdb/ChangeLog: * windows-nat.c (windows_delete_thread): Add missing space in cast expression.
2013-05-302013-05-30 Hafiz Abid Qadeer <abidh@codesourcery.com>Hafiz Abid Qadeer2-1/+9
* inferior.c (top level): Include tilde.h. (add_inferior_command): Call tilde_expand on the value of 'exec' argument.
2013-05-30gdb/Yao Qi4-9/+17
* tracepoint.c (encode_actions_1): Remove parameter 't'. Caller update. (encode_actions): Likewise. * remote.c (remote_download_tracepoint): Caller update. * tracepoint.h (encode_actions): Update declaration.
2013-05-30Fix build breakage with Python 2.4.Pedro Alves2-1/+9
With Python 2.4, we see this build failure: ./python/python-internal.h: In function 'gdb_Py_DECREF': ./python/python-internal.h:179: warning: dereferencing 'void *' pointer ./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union Python 2.4 forgets to cast 'op' to PyObject pointer on the ob_refcnt accesses: #define Py_DECREF(op) \ if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ --(op)->ob_refcnt != 0) \ _Py_CHECK_REFCNT(op) \ else \ _Py_Dealloc((PyObject *)(op)) ... #define _Py_CHECK_REFCNT(OP) \ { if ((OP)->ob_refcnt < 0) \ _Py_NegativeRefcount(__FILE__, __LINE__, \ (PyObject *)(OP)); \ } Python 2.7: #define Py_DECREF(op) \ do { \ if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ --((PyObject*)(op))->ob_refcnt != 0) \ _Py_CHECK_REFCNT(op) \ else \ _Py_Dealloc((PyObject *)(op)); \ } while (0) ... #define _Py_CHECK_REFCNT(OP) \ { if (((PyObject*)OP)->ob_refcnt < 0) \ _Py_NegativeRefcount(__FILE__, __LINE__, \ (PyObject *)(OP)); \ } gdb/ 2013-05-30 Pedro Alves <palves@redhat.com> * python/python-internal.h (gdb_Py_DECREF): Cast OP to PyObject pointer.
2013-05-30gdb/Yao Qi2-4/+11
* remote.c (remote_check_symbols): Remove unused parameter 'objfile'. Declaration update. (remote_start_remote, remote_new_objfile): Caller update.
2013-05-30gdb/Yao Qi4-1/+16
* mi/mi-cmds.c (mi_cmds): Define MI command '-exec-arguments' by macro DEF_MI_CMD_CLI_1 instead of DEF_MI_CMD_CLI. gdb/testsuite/ * gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed): Add a test that no MI notification is emitted when executing -exec-arguments.
2013-05-30*** empty log message ***gdbadmin1-1/+1
2013-05-30daily updateAlan Modra1-1/+1
2013-05-29 gas/Maciej W. Rozycki12-3/+119
* write.c (resolve_reloc_expr_symbols): On REL targets don't convert relocs who have no relocatable field either. Rephrase the conditional so that the PC-relative check is only applied for REL targets. gas/testsuite/ * gas/mips/jalr3.d: New test. * gas/mips/jalr3-n32.d: New test. * gas/mips/jalr3-n64.d: New test. * gas/mips/jalr3.s: New test source. * gas/mips/mips.exp: Run the new tests. ld/testsuite/ * ld-mips-elf/jalr3.dd: New test. * ld-mips-elf/jalr3.ld: New test linker script. * ld-mips-elf/mips-elf.exp: Run the new test.
2013-05-29 * dwarf2.c (struct dwarf2_debug): Add fields for handlingNick Clifton4-46/+320
alternate debug info source. (dwarf_debug_sections): Add entries for alternate .debug_str and .debug_info sections. (dwarf_debug_section_enum): Likewise. (read_alt_indirect_string): New function. Handles a DW_FORM_GNU_strp_alt attribute. (read_alt_indirect_ref): New function. Handles a DW_FORM_GNU_ref_alt attribute. (read_attribute_value): Process DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt. (find_abstract_instance_name): Handle DW_FORM_GNU_ref_alt attributes. (_bfd_dwarf2_cleanup_debug_info): Free alternate debug info sources. * opncls.c (GNU_DEBUGALTLINK): Define. (bfd_get_alt_debug_link_info): New function. (separate_alt_debug_file_exists): New function. (find_separate_debug_file): Add parameters for fetch and check functions. (bfd_follow_gnu_debugaltlink): New function. * bfd-in2.h: Regenerate.
2013-05-29[remote] Insert breakpoints in the right process.Pedro Alves2-0/+48
I noticed that gdb.multi/multi-arch.exp wasn't passing with extended-remote GDBserver with my pending multi-process+multi-arch series anymore on current mainline, while it used to pass before: (gdb) run Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/ma-hangout Process /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/ma-hangout created; pid = 32067 Warning: Cannot insert breakpoint 2. Error accessing memory address 0x4005c2: Unknown error -1. Cannot insert breakpoint -1. Temporarily disabling shared library breakpoints: breakpoint #-1 (gdb) FAIL: gdb.multi/multi-arch.exp: starting inferior 2 Investigating manually, I found an easy way to reproduce. You just need breakpoints on distinct inferiors, and a way to have GDB install them in one go: (gdb) set breakpoint always-inserted on (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint del n <MULTIPLE> 2.1 y 0x00000000004005c2 in main at ../../../src/gdb/testsuite/gdb.multi/hello.c:40 inf 1 2.2 y 0x08048475 in main at ../../../src/gdb/testsuite/gdb.multi/hangout.c:22 inf 2 (gdb) enable 2 Warning: Cannot insert breakpoint 2. Error accessing memory address 0x4005c2: Unknown error -1. And turning on remote debugging, we see: (gdb) set debug remote 1 (gdb) disable 2 (gdb) enable 2 Sending packet: $Z0,4005c2,1#71...Packet received: E01 Sending packet: $Z0,8048475,1#87...Packet received: OK Warning: Cannot insert breakpoint 2. Error accessing memory address 0x4005c2: Unknown error -1. Notice that each of those Z0 breakpoints should be set in different processes. However, no Hg packet to select a process has been sent in between, so GDBserver tries to plant both on the same process that happens to be current. The first Z0 then not so surprisingly fails. IOW, the blame is on GDB, for telling GDBserver to plant both breakpoints in the same process. remote.c has a lazy scheme where it keeps a local cache of the remote's selected general thread, and delays updating it on the remote side until necessary (memory/register reads/writes, etc.). This is done to reduce RSP traffic. The bug is that the Zx breakpoint insert/remove methods weren't committing the selected thread/process back to the remote side: Breakpoint 3, remote_insert_breakpoint (gdbarch=0x1383ae0, bp_tgt=0x140c2b0) at ../../src/gdb/remote.c:8148 8148 if (remote_protocol_packets[PACKET_Z0].support != PACKET_DISABLE) (top-gdb) p inferior_ptid $3 = {pid = 3670, lwp = 0, tid = 3670} (top-gdb) p general_thread $4 = {pid = 3671, lwp = 0, tid = 3671} IOW, a call to set_general_process is missing. I did some auditing over remote.c, and added calls to all places I found missing it. This only used to work by chance before. breakpoint.c switches to a thread of the target process before installing a breakpoint location. That calls switch_to_thread. Before: 2012-07-27 Yao Qi <yao@codesourcery.com> * thread.c (switch_to_thread): Don't call registers_changed. that caused the register caches to all be flushed and refetched before installing the breakpoint location. Given fetching registers commits the remote general thread (with Hg), masking out the latent bug. Tested on x86_64 Fedora 17 with GDBserver. gdb/ 2013-05-29 Pedro Alves <palves@redhat.com> * remote.c (remote_insert_breakpoint, remote_remove_breakpoint) (remote_insert_watchpoint, remote_remove_watchpoint) (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint) (remote_verify_memory, compare_sections_command) (remote_search_memory): Set the general process/thread on the remote side.
2013-05-29[AArch64] Remove all traces of aarch64-without-fpu.xml.Pedro Alves6-108/+11
The aarch64-without-fpu description is unused. Linux requires an FPU, so the AArch64 native port always returns the with-fpu variant: static const struct target_desc * aarch64_linux_read_description (struct target_ops *ops) { initialize_tdesc_aarch64 (); return tdesc_aarch64; } When the target doesn't report a target description at all, we fallback to a register set with an FPU: aarch64_gdbarch_init () ... if (!tdesc_has_registers (tdesc)) tdesc = tdesc_aarch64; This just removes the dead description. Tested by building on x86_64 Fedora 17 with --enable=targets=all. gdb/ 2013-05-29 Pedro Alves <palves@redhat.com> * aarch64-tdep.c: Don't include "features/aarch64-without-fpu.c". (_initialize_aarch64_tdep): Don't call initialize_tdesc_aarch64_without_fpu. * features/Makefile (WHICH): Remove reference to aarch64-without-fpu. * features/aarch64-without-fpu.c: Delete file. * regformats/aarch64-without-fpu.dat: Delete file.
2013-05-29binutils/Cary Coutant43-977/+1031
* dwarf.c (display_debug_lines_raw): Print section offsets. binutils/testsuite/ * binutils-all/dw2-1.W: Adjust expected output. * binutils-all/objdump.W: Likewise. * binutils-all/i386/compressed-1a.d: Likewise. * binutils-all/x86-64/compressed-1a.d: Likewise. gas/testsuite/ * gas/cris/rd-dw2-1.d: Adjust expected output. * gas/cris/rd-dw2-10.d: Likewise. * gas/cris/rd-dw2-11.d: Likewise. * gas/cris/rd-dw2-12.d: Likewise. * gas/cris/rd-dw2-13.d: Likewise. * gas/cris/rd-dw2-14.d: Likewise. * gas/cris/rd-dw2-15.d: Likewise. * gas/cris/rd-dw2-2.d: Likewise. * gas/cris/rd-dw2-3.d: Likewise. * gas/cris/rd-dw2-4.d: Likewise. * gas/cris/rd-dw2-5.d: Likewise. * gas/cris/rd-dw2-6.d: Likewise. * gas/cris/rd-dw2-7.d: Likewise. * gas/cris/rd-dw2-8.d: Likewise. * gas/cris/rd-dw2-9.d: Likewise. * gas/elf/dwarf2-1.d: Likewise. * gas/elf/dwarf2-2.d: Likewise. * gas/elf/dwarf2-3.d: Likewise. * gas/i386/debug1.d: Likewise. * gas/i386/dw2-compress-1.d: Likewise. * gas/i386/ilp32/lns/lns-common-1.d: Likewise. * gas/i386/ilp32/lns/lns-duplicate.d: Likewise. * gas/ia64/pr13167.d: Likewise. * gas/lns/lns-big-delta.d: Likewise. * gas/lns/lns-common-1-alt.d: Likewise. * gas/lns/lns-common-1.d: Likewise. * gas/lns/lns-duplicate.d: Likewise. * gas/mips/loc-swap-2.d: Likewise. * gas/mips/loc-swap.d: Likewise. * gas/mips/micromips@loc-swap-2.d: Likewise. * gas/mips/micromips@loc-swap.d: Likewise. * gas/mips/mips16-dwarf2-n32.d: Likewise. * gas/mips/mips16-dwarf2.d: Likewise. * gas/mips/mips16@loc-swap-2.d: Likewise. * gas/mips/mips16@loc-swap.d: Likewise.
2013-05-29daily updateAlan Modra1-1/+1
2013-05-29*** empty log message ***gdbadmin1-1/+1
2013-05-28 gas/Maciej W. Rozycki17-1/+186
* config/tc-mips.c (macro) <ld>: Don't use $zero for address calculation. gas/testsuite/ * gas/mips/ld-zero.d: New test. * gas/mips/ld-zero-2.d: New test. * gas/mips/ld-zero-3.d: New test. * gas/mips/ld-zero-q.d: New test. * gas/mips/ld-zero-u.d: New test. * gas/mips/ecoff@ld-zero-3.d: New test. * gas/mips/micromips@ld-zero-2.d: New test. * gas/mips/micromips@ld-zero-3.d: New test. * gas/mips/ld-zero.s: New test source. * gas/mips/ld-zero-2.s: New test source. * gas/mips/ld-zero-3.s: New test source. * gas/mips/ld-zero-q.s: New test source. * gas/mips/ld-zero-u.s: New test source. * gas/mips/mips.exp: Run the new tests.
2013-05-28Correct the relocation names for R_AARCH64_TLSDESC_LD_PREL19 and ↵Yufeng Zhang12-31/+73
R_AARCH64_TLSDESC_ADR_PAGE21.
2013-05-28gas/Kyrylo Tkachov5-16/+26
2013-05-28 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/tc-arm.c (it_fsm_post_encode): Improve warning messages about deprecated IT block formats. gas/testsuite 2013-05-28 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * gas/arm/armv8-a-bad.l: Update expected warning message. * gas/arm/armv8-a-it-bad.l: Likewise.
2013-05-28[GDBserver][AArch64] Remove references to aarch64-without-fpu.xml.Pedro Alves4-8/+11
The GDBserver Aarch64 port includes the aarch64-without-fpu description in the build, but doesn't actually use it anywhere. As Linux always requires an FPU, just remove the dead code. gdb/gdbserver/ 2013-05-28 Pedro Alves <palves@redhat.com> * Makefile.in (clean): Remove reference to aarch64-without-fpu.c. (aarch64-without-fpu.c): Delete rule. * configure.srv (aarch64*-*-linux*): Remove references to aarch64-without-fpu.o and aarch64-without-fpu.xml. * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove declaration.
2013-05-28[AArch64] Range check only resolved relocations.Marcus Shawcroft13-26/+115
2013-05-28 Marcus Shawcroft <marcus.shawcroft@arm.com> * config/tc-aarch64.c (md_apply_fix): Move value range checking inside fx_done condition. 2013-05-28 Marcus Shawcroft <marcus.shawcroft@arm.com> * gas/aarch64/adr_1.d: New file. * gas/aarch64/adr_1.s: New file. * gas/aarch64/b_1.d: New file. * gas/aarch64/b_1.s: New file. * gas/aarch64/beq_1.d: New file. * gas/aarch64/beq_1.s: New file. * gas/aarch64/ldr_1.d: New file. * gas/aarch64/ldr_1.s: New file. * gas/aarch64/tbz_1.d: New file. * gas/aarch64/tbz_1.s: New file.
2013-05-28gdb/Yao Qi2-6/+9
* tracepoint.c (stringify_collection_list): Remove parameter 'string'. (encode_actions): Caller update. Remove local variables.
2013-05-28daily updateAlan Modra1-1/+1
2013-05-28*** empty log message ***gdbadmin1-1/+1
2013-05-27bfd: Make bfd_cache_max_open depend on actual open file limit.Mark Wielaard6-13/+65
The current hard coded limit of open files in bfd/cache.c is 10. This is pretty low these days. Binaries are often linked against much more than 10 files (and sometimes against more than 100 shared libraries). When debugging with GDB some files are opened and closed multiple times because of this low limit. If possible make the BFD cache file limit depend on the actual open file limit of the process so more BFD files can be open at the same time. * cache.c (BFD_CACHE_MAX_OPEN): Remove define. (max_open_files): New static int initialized to zero. (bfd_cache_max_open): New static function to set and return max_open_files. (bfd_cache_init): Use bfd_cache_max_open. (bfd_open_file): Likewise. * configure.in (AC_CHECK_HEADERS): Add sys/resource.h. (AC_CHECK_FUNCS): Add getrlimit. * configure: Regenerated. * config.in: Likewise. * sysdep.h: Check and include sys/resource.h for getrlimit.
2013-05-27daily updateAlan Modra1-1/+1
2013-05-27*** empty log message ***gdbadmin1-1/+1
2013-05-26daily updateAlan Modra1-1/+1
2013-05-26*** empty log message ***gdbadmin1-1/+1
2013-05-25daily updateAlan Modra1-1/+1
2013-05-25*** empty log message ***gdbadmin1-1/+1
2013-05-24opcodes/Richard Sandiford6-1/+16
* s390-opc.txt (flogr): Require a register pair destination. gas/testsuite/ * gas/s390/zarch-z9-109-err.s, gas/s390/zarch-z9-109-err.l: New test. * gas/s390/s390.exp: Run it.
2013-05-24gdb/testsuite/Jan Kratochvil2-4/+31
PR testsuite/12649 * gdb.mi/mi-dprintf.exp (mi_continue_dprintf) (mi 2nd dprintf): Replace $mi_gdb_prompt expectation by mi_expect_stop. (mi 1st dprintf, agent, mi 2nd dprintf, agent) (mi info dprintf second time): Replace them by mi_send_resuming_command and mi_expect_stop.
2013-05-242013-05-24 Gary Benson <gbenson@redhat.com>Gary Benson4-3/+12
* gdb.base/solib-disc.exp (exec_opts): Remove unnecesary backslash. * gdb.base/unload.exp (exec_opts): Remove two unnecessary backslashes. * gdb.base/watchpoint-solib.exp (exec_opts): Remove unnecesary backslash.
2013-05-24gdb/Yao Qi4-19/+17
* tracepoint.c (TFILE_PID): Remove. (tfile_open): Don't add thread and inferior. (tfile_close): Don't set 'inferior_ptid'. Don't call exit_inferior_silent. (tfile_thread_alive): Remove. (init_tfile_ops): Don't set field 'to_thread_alive' of tfile_ops. gdb/testsuite/ * gdb.trace/tfile.exp: Test inferior and thread.
2013-05-24[gdbserver] Don't assume vCont;r ADDR1,ADDR2 comes with a ptid attached.Pedro Alves2-8/+13
This bit: + p1 = strchr (p, ':'); + decode_address (&resume_info[i].step_range_end, p, p1 - p); should not expect the ':' to be there. An action without a ptid is valid: "If an action is specified with no thread-id, then it is applied to any threads that don't have a specific action specified" This is handled further below: if (p[0] == 0) { resume_info[i].thread = minus_one_ptid; default_action = resume_info[i]; /* Note: we don't increment i here, we'll overwrite this entry the next time through. */ } else if (p[0] == ':') A stub that doesn't support and report to gdb thread ids at all (like metal metal targets) only will always only see a single default action with no ptid. Use unpack_varlen_hex instead of decode_address. The former doesn't need to be told where the hex number ends, and it actually returns that info instead, which we can use for validation. Tested on x86_64 Fedora 17. gdb/gdbserver/ 2013-05-24 Pedro Alves <palves@redhat.com> * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex instead of strchr/decode_address. Error if the range isn't split with a ','. Don't assume there's be a ':' in the action.
2013-05-24gdb/testsuite/Yao Qi3-2/+22
* gdb.base/range-stepping.exp: Skip the rest of tests if the test fails. * lib/range-stepping-support.exp (exec_cmd_expect_vCont_count): Return 0 if the test passes, otherwise return 1.
2013-05-24Fix gdb.info build failureJoel Brobecker2-1/+11
gdb.texinfo:36367: `Installed System-wide Configuration Scripts' has no Up field (perhaps incorrect sectioning?). gdb.texinfo:36367: warning: unreferenced node `Installed System-wide Configuration Scripts'. gdb/doc/ChangeLog: * gdb.texinfo (System-wide Configuration Scripts): Renames "Installed System-wide Configuration Scripts". Add associated @menu block.
2013-05-24Update to load fission.exp.Doug Evans1-15/+3