aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-05-302013-05-30 Paul Brook <paul@codesourcery.com>Catherine Moore11-0/+96
bfd/ * bfd-in2.h: Regenerate. * elf32-mips.c (elf_mips_eh_howto): New. (bfd_elf32_bfd_reloc_type_lookup ): Support BFD_RELOC_MIPS_EH. (bfd_elf32_bfd_reloc_name_lookup): Likewise. (mips_elf32_rtype_to_howto): Support R_MIPS_EH. * elf64-mips.c (elf_mips_eh_howto): New. (bfd_elf64_bfd_reloc_type_lookup): Support BFD_RELOC_MIPS_EH. (bfd_elf64_bfd_reloc_name_lookup): Likewise. (mips_elf64_rtype_to_howto): Support R_MIPS_EH. * libbfd.h: Regenerate. * reloc.c (BFD_RELOC_MIPS_EH): New. gas/ * config/tc-mips.c (md_apply_fix): Support BFD_RELOC_MIPS_EH. include/elf * mips.h (R_MIPS_EH): New.
2013-05-30maintenance_expand_symtabs leaks a cleanupTom Tromey2-0/+6
It turns out that maintenance_expand_symtabs was missing a call to do_cleanups. I found this using the cleanup checker. * symmisc.c (maintenance_expand_symtabs): Call do_cleanups.
2013-05-30fix up xml-support.cTom Tromey3-36/+25
xml-support.c has a function that returns a cleanup via an out parameter. This changes this function to be a normal cleanup constructor -- returning the cleanup directly and returning the other result via an out parameter. This is sort of a hack, but it lets the checker work here. I also noticed that gdb_xml_create_parser_and_cleanup does not need to be exported any more. * xml-support.c (gdb_xml_create_parser_and_cleanup): Rename from gdb_xml_create_parser_and_cleanup_1. Return a cleanup. Remove 'old_chain' argument. Add 'parser_result' argument. (gdb_xml_create_parser_and_cleanup): Remove old version. (gdb_xml_parse_quick): Update. (xml_process_xincludes): Update. * xml-support.h (gdb_xml_create_parser_and_cleanup): Don't declare.
2013-05-30fix compile_rx_or_errorTom Tromey3-7/+16
compile_rx_or_error looks like a constructor, but it can return NULL. This patch changes it to remove the NULL return, making it work like any other cleanup constructor. This is a stylistic patch but I think it is also better for code to follow the normal conventions. * probe.c (collect_probes): Check arguments for NULL before calling compile_rx_or_error. * utils.c (compile_rx_or_error): Require 'rx' to be non-NULL. Remove NULL return.
2013-05-30some fixes to infrun.cTom Tromey2-4/+8
This fixes some of the problems in infrun.c that the checker reported. I filed the remaining problems as bugs. This patch is purely stylistic. * infrun.c (adjust_pc_after_break): Introduce an outer null cleanup.
2013-05-30fix mi-cmd-var.cTom Tromey2-4/+7
This is a stylistic change in mi-cmd-var.c that adds outer cleanups where needed by the checker. * mi/mi-cmd-var.c (varobj_update_one): Add an outer null cleanup.
2013-05-30fix cli-script.cTom Tromey2-12/+12
read_command_lines_1 had some (IMNSHO) spaghetti-ish code for cleanup handling. This makes the code much simpler to understand, by introducing an outer cleanup. This is another case where a stylistic change for the checker is also nice for the reader. * cli/cli-script.c (read_command_lines_1): Use a null cleanup for 'old_chain'. Do not check 'head' before processing cleanups.
2013-05-30fix mi-cmd-stack.cTom Tromey2-4/+6
mi-cmd-stack.d had a conditional cleanup, "cleanup_tuple" that confused the checker. However, there was no need for this, since it was only used via do_cleanups at the end of the function, just before another call to do_cleanups. So, while this is a stylistic patch for the checker, I also consider it a generic improvement for readers of the code. * mi/mi-cmd-stack.c (list_arg_or_local): Remove "cleanup_tuple".
2013-05-30fix dbxread.cTom Tromey2-5/+11
This is a stylistic change to make some code in dbxread.c analyzable by the checker. * dbxread.c (dbx_read_symtab): Declare 'back_to' in a more inner scope. Unconditionally call do_cleanups.
2013-05-30fix source.cTom Tromey2-0/+8
find_and_open_source can leak a cleanup. * source.c (find_and_open_source): Call do_cleanups.
2013-05-30fix linux-thread-db.cTom Tromey2-4/+9
This is a stylistic change to make it so the checker can analyze a function in linux-thread-db.c. * linux-thread-db.c (thread_db_load_search): Unconditionally call do_cleanups.
2013-05-30fix in solib-aix.cTom Tromey2-2/+7
solib_aix_bfd_open has an early "return" that doesn't run cleanups. This fixes the problem by dropping the null_cleanup and using a later cleanup as the master cleanup for the function. * solib-aix.c (solib_aix_bfd_open): Don't use a null cleanup for 'cleanup'; instead use a later one.
2013-05-30use explicit returns to avoid checker confusionTom Tromey4-3/+13
The checker does not understand the idiom if (except.reason < 0) { do_cleanups (whatever); GDB_PY_HANDLE_EXCEPTION (except); } because it doesn't realize that the nested 'if' actually has the same condition. This fixes instances of this to be more explicit. * python/py-breakpoint.c (bppy_get_commands): Use explicit, unconditional return. * python/py-frame.c (frapy_read_var): Likewise. * python/python.c (gdbpy_decode_line): Likewise.
2013-05-30fix cp-namespace.cTom Tromey2-1/+9
cp_lookup_symbol_imports_or_template could return without running cleanups. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Call do_cleanups on all return paths.
2013-05-30fix top.cTom Tromey2-0/+5
execute_command can leak a cleanup along one return path. * top.c (execute_command): Discard 'cleanup_if_error' cleanups.
2013-05-30fix one bug in stabsread.cTom Tromey2-1/+9
Some code in stabsread.c can return without running cleanups. * stabsread.c (read_struct_type): Call do_cleanups along all return paths.
2013-05-30 * mips-linux-tdep.c: Adjust formatting throughout.Maciej W. Rozycki2-59/+60
2013-05-30fix mipsread.cTom Tromey2-5/+25
Some code in mipsread.c could leak cleanups along some return paths. * mipsread.c (read_alphacoff_dynamic_symtab): Call do_cleanups along all return paths.
2013-05-30fix one bug in symfile.cTom Tromey2-2/+13
find_separate_debug_file could leak a cleanup along some return paths. * symfile.c (find_separate_debug_file): Call do_cleanups along all return paths.
2013-05-30fix symtab.cTom Tromey2-1/+6
search_symbols had some bad code resulting in a cleanup being both discarded and run. * symtab.c (search_symbols): Introduce a null cleanup for 'retval_chain'.
2013-05-30fix py-value.cTom Tromey2-2/+13
Some code in py-value.c could exit a loop without running some cleanups made in the loop. * python/py-value.c (valpy_binop): Call do_cleanups before exiting loop.
2013-05-30fix py-prettyprint.cTom Tromey2-2/+5
print_children, in py-prettyprint.c, could call do_cleanups twice on the same cleanup. * python/py-prettyprint.c (print_children): Remove extra do_cleanups call.
2013-05-30fix py-frame.cTom Tromey2-1/+11
A couple return paths in frapy_read_var were missing do_cleanups calls. * python/py-frame.c (frapy_read_var): Call do_cleanups along all return paths.
2013-05-30fix py-breakpoint.cTom Tromey2-1/+10
One return path in bppy_get_commands was missing a do_cleanups call. * python/py-breakpoint.c (bppy_get_commands): Call do_cleanups along all return paths.
2013-05-30simplify cli-logging.c for analysisTom Tromey2-4/+10
This is another stylistic patch. It changes cli-logging.c to be analyzable by the checker, again following the method of adding an outer cleanup and unconditionally calling do_cleanups. * cli/cli-logging.c (set_logging_redirect): Unconditionally call do_cleanups.
2013-05-30fix varobj.cTom Tromey2-3/+6
c_value_of_root is missing a call to do_cleanups at one return. This fixes the problem by removing that return and letting control fall through. * varobj.c (c_value_of_root): Call do_cleanups along all return paths.
2013-05-30make a cleanup unconditionally in tracepoint.cTom Tromey2-4/+9
This is another cosmetic patch. It introduces an "outer" cleanup in trace_dump_command and arranges to unconditionally call do_cleanups. This lets the checker analyze the function. * tracepoint.c (trace_dump_command): Unconditionally call do_cleanups.
2013-05-30fix two buglets in breakpoint.cTom Tromey2-4/+10
First, output_thread_groups leaks a cleanup along one return path. Second, parse_cmd_to_aexpr could return without running its cleanups, if there was an exception in a TRY_CATCH. * breakpoint.c (output_thread_groups, parse_cmd_to_aexpr): Call do_cleanups earlier.
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.