public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  tromey/cleanup-checker: introduce scoped cleanups
@ 2013-05-09 17:56 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2013-05-09 17:56 UTC (permalink / raw)
  To: archer-commits

The branch, tromey/cleanup-checker has been updated
  discards  ecc236fbd1bf2e02ba923072ec1861f17ca0b369 (commit)
  discards  5aa931fe2c861e072c98d315736fb0e9a917548d (commit)
  discards  6d3278189a492c717aa0cee73d40abff79cfd1c7 (commit)
  discards  1e7f1c853c0909e2cf49a4fdb7092625cfb3b638 (commit)
  discards  f5d8768064370f71e441a6dd3e36c0a655a4909d (commit)
  discards  feb6b240ba3b8287d7811e724f7d2a757f7036f8 (commit)
  discards  93c05d00126fa73e466c98152a317bac44e0d706 (commit)
  discards  80f1e1823a35cadae3cb9edbff07cb32db7a8fb5 (commit)
  discards  f8df69f089276a755079574389e8c523fe9473ae (commit)
  discards  6af776a4b12c249e38890870c5fd1f189c5c7476 (commit)
  discards  1d8ed983a3058aa02fd4234dff64845cd372d589 (commit)
  discards  b3a66cc8077f13c7825971a68b0f4dc1e24fe5ef (commit)
  discards  0bdeb6063a6ec77247708b2895c535d1a81804c8 (commit)
  discards  3f3e06f01707a6db8fdcc75c6d8ea9cd5e268367 (commit)
  discards  8fdd706d80556731074e530afd94479a45e1dba7 (commit)
  discards  f6d3a4cd708782a607a65719b639d2e15a12453b (commit)
  discards  77a8d47d47db24a084db63846bec46737caaabe1 (commit)
  discards  a49dd4322cf68555a1b82ad1ab2c0e12b47ad700 (commit)
  discards  05b834469f15dce48398c4104cb5298ff7a9463c (commit)
  discards  772c5f0a79a8e19a14eefd2d461b143837dc448a (commit)
  discards  994c401b55c2f208c44eb449a09d8537600d8e3b (commit)
  discards  db1575ec50fb5bce9adfc7ca3ba63e5afcbbaa6f (commit)
  discards  5aa4ca404d2d134f729d6cbd8d6ee38dd0cb0d20 (commit)
  discards  832f131554ea16f749f40439ad7944e2efcc5cb6 (commit)
  discards  0ea9b81d692c800bd38dcc9dbd0d0fd8858c0186 (commit)
  discards  2ea4e36165d81c3fc6fd459e8a101bb085225a4b (commit)
  discards  1a24267c12cc9bbdb8695f438b79f49e9bc6d872 (commit)
  discards  2bd9f1e30a6819da0c38744ec5bbeffab6061bd3 (commit)
  discards  2380f715ef852d1bfa19d5d9666c808e76882c72 (commit)
  discards  29712c3695dcb3e585c010744b23b0db08eb41d7 (commit)
  discards  d50200bd08f366213b7a71d6f9895f5008cbafef (commit)
  discards  7439ee0936eb62851b5f753a70e434409cbb60bf (commit)
  discards  998b0010b7793fc8fa96fb1fe877d0a23e1b3c1f (commit)
  discards  ee2c1584228ce5a4bb59ee425db29dce268fe9e5 (commit)
  discards  ca73ab8abd16e31cec146e087ece56c90fef8407 (commit)
  discards  5a414e384b344b8746ae1e5cad93925f7d2b56d5 (commit)
  discards  f41136a59e19433de47fcf3a02b00a661e5d5dd3 (commit)
  discards  38141322430d578bf0effb07080ab2d1ba1c8a91 (commit)
  discards  16f072558044d59ca3ba23521e8a48752e17a5e9 (commit)
  discards  0b04fc0361a4e0c173375d8336cb2acbad1adabf (commit)
  discards  50dc7d8c8d3307ae284e46a28fda133008923167 (commit)
  discards  a1d50e6f623d5a85c84cdcad3f0f893ac1c62c9b (commit)
  discards  3439e21d00c277a8a36f222409743fcd60293b8e (commit)
  discards  c0566818b4a68cbd0245452ba4ce6fffea71b658 (commit)
  discards  2935df1bd057731c60178e8344514c91789616e0 (commit)
       via  9b1fe3dce529c03c56b26b92eadbac1f866ce955 (commit)
       via  28bbcf20b7b4a0f597237b56a7eb8793c65edbed (commit)
       via  b742ab349892cce15df6d761190d17eb27a23976 (commit)
       via  72b491c4ccd7996cf471b85b346616f207e69760 (commit)
       via  f1ed049596b4deed84518830462a7ffbd371979c (commit)
       via  09983ec5522012abad22c2484ede6d58c346cf26 (commit)
       via  c76ac86917cfd5f8d783730da496285ac7d956d2 (commit)
       via  cdcd1ee9c3501362c7071ec6b0e818d5ef775809 (commit)
       via  bb421a989e7dc3696315823b8918092f0ee174c8 (commit)
       via  6d00e10eddf7b9b5594aedb29d2e2135eb116800 (commit)
       via  09f8d24b18b1f4beea87459625e0ce2a6bf03992 (commit)
       via  a0b282774d0e5948ea2655ac2ec496cacea7a9ba (commit)
       via  29862d1dbc5bb0ffb1057fe4775efc0d0c83bdf0 (commit)
       via  27ac4476e9e4f7a238ca9f86ec955ef6d2d21c02 (commit)
       via  9de1593e2a53e2414bfb06ccd238a2a4adc148be (commit)
       via  22b53119e9c8e26a32ff9300d698725e29cd123c (commit)
       via  5bd523b8ded5668a3e8ad94f2951300d4eebcecf (commit)
       via  8151eef178cd96ab3106cccaa3afc8ece5b69d71 (commit)
       via  1ebfefe7d65c7532c9e13534b43915d6c0f3661e (commit)
       via  f839ed581f8468feb9294637cf8e8367de36080c (commit)
       via  0c04640cda1b579c51d4e8025be9202a374f040b (commit)
       via  0567c8d5e10110e8c6590c0b1ca9bcfad6500f49 (commit)
       via  76ff0a4abfd2d95bee57e14b151c26f4ad42e80c (commit)
       via  f5a385fdac093cd96ac660b38a2a9ba199b98044 (commit)
       via  ab1481fe59388b02c51c672114261bcb40261ca7 (commit)
       via  4904a5c8b2929216849840bc807a85ea30300176 (commit)
       via  568e3554958cb42488bc51f5e2bd8b5cd817803c (commit)
       via  9950c2e4c9891c1b716d6c6d32107ddd7e97c5a5 (commit)
       via  668178b2c763a59e4651dabd10ee38fdddc37d2a (commit)
       via  b82374f54619bb0d461d91ab5a40365992548976 (commit)
       via  9b80994f1e27a03ac3bf3dadfbebf1f7837deb92 (commit)
       via  a7e8faba7c73d1912025d17f01aa3a9a757d832f (commit)
       via  36cafe4607fda38a06212cbdb7de1723d1da6f57 (commit)
       via  39b5a3293ce43e0a2d1d79633d99bd88e33801e6 (commit)
       via  f3008ba4857500b99ba46752a25a351b6b4777b8 (commit)
       via  92e6b6a1fe3fd7885440b6980377af3ea3214374 (commit)
       via  284f852a6a591eebee8ad7771a6bb9a2c23d6894 (commit)
       via  c0ee22e97e7faba76eb25f400bdb3e4c90ca4f40 (commit)
       via  b5bf6ca0277ca19092a95363f6d941f388aebb9a (commit)
       via  db7f01b90cfe91e8983a96110a63d4fa2c38c598 (commit)
       via  71e35171076ebf86e6c9317cf02fbbb278e9838f (commit)
       via  c96847a6874989b24231a314760776becb458c59 (commit)
       via  95615b4a2932c1cbb5e8314afa4f43b1c38a9ee8 (commit)
       via  485edc33433aae5742e8cc4fbefdeea586dd7623 (commit)
       via  6b0f6001d42f7626cccaf964ce7e218efbc02176 (commit)
       via  de8127d5c010f93939533769c6adc6e55cec9630 (commit)
       via  bf21d1963b2a80db660b586ff2bf5fe372b28268 (commit)
       via  808e8fdc1d868072ed6cd214603d690d93597c31 (commit)
       via  69258f21f6ff1184208c2d3e1110ababc781bec3 (commit)
       via  fa23708ed5f8249d38948f8d5269bfbbca088417 (commit)
       via  390e57deb940ca7330a27b33d1e89652362295fb (commit)
       via  17e668f7b1ca5ce96a51886433cb751a0e6a2a2e (commit)
       via  cd402a50a7be87d91aa0b0b6e4aa09da6527bbd2 (commit)
       via  8f10c3cb14e9a12eee7080c48e4f1404a6bd75b4 (commit)
       via  d9fc67bdef1d95429ac87b80ce9ee6cbcf536878 (commit)
       via  9811ffc67ae31043fa2140ab167083f3c299f308 (commit)
       via  658b1ee171991584f177badbe08216007220ee9b (commit)
       via  5cfeb4fbc6e51fe4f3e1a89bfc2e9f0f76ffa644 (commit)
       via  d7761df5830ad220cf0ff47e927879d8be7b77c4 (commit)
       via  4ef075f1ce5709607742403fb09c9ec83c85d381 (commit)
       via  071db9fe6db5df2a5997bf873e5f3ce28739c607 (commit)
       via  76d89bfcab8015a6363fad057408d4dc73c342f9 (commit)
       via  24158df9a7c93227c2df45c4211b01d363c6ffb4 (commit)
       via  3ae4170839d072180476bd01b747d95d0b63ed12 (commit)
       via  364608b10bfbcf8943f5e18808734ddcc9206cd4 (commit)
       via  7040211e0e969a8cc08934eeec37e67468015079 (commit)
       via  b8f263742a5673f4ddf988bf93b65274168dc8d9 (commit)
       via  5fa94527e555568c45ddee87fbf6cffe68890a1b (commit)
       via  21d0dc4e8b695d4640942eccb0be44b4267e1f9a (commit)
       via  fa3c0d517f8c36110983288ef2f3cf4bbf4a7f36 (commit)
       via  e012852a9958f732e79d687fc712ec3aba597198 (commit)
       via  616e118a7e18a8eef32b846b7e9d7d4197cec627 (commit)
       via  28ec3e247cc22ecd040eccc138171e6b5746b211 (commit)
       via  1abe07e6a2c57536afbe6f0ddb14f3e9b1d83509 (commit)
       via  1fead7632f25000bedff5f753a32b9987117d66a (commit)
       via  30d53ace28f23643886348bbd13a78d92c305237 (commit)
       via  b0ebc73aab236db66ed9baa3a3c1f5ad6336d3c5 (commit)
       via  d11968d37d20ed65dc9432822b83e948d95b46fe (commit)
       via  07c04815e9ba61fb80dfa8b09c88eaabf432126e (commit)
       via  9476ac0cbd9ac8410ce1541b5ea0edae425ef3d5 (commit)
       via  fdf76be874627e0dde995e5555e2c6926bf88db7 (commit)
       via  b490dc7610f05ed3a3eb9227c82cf1a5cf8f7c97 (commit)
       via  d9b323ee990314df7981c2d599e932606abc74a4 (commit)
       via  1bd49fda93db2805d821307ac8cf65e01d5b54a4 (commit)
       via  8a3b4bbdafa5b601e0af356dc73b88b06c6d7332 (commit)
       via  8ef0b952c0422658fb407917888d4c98fa55117f (commit)
       via  faa73d425d03b16dcbb3d7135872558c1852dd45 (commit)
       via  a9fce1bc95601cd0521adb498a5c3d00a2f41aed (commit)
       via  f38f5ec74d176ff96ee2a3e642a2920d0e130d20 (commit)
       via  dc40faa5c564ede6b8f901bc1a7dee76c18c2861 (commit)
       via  1b8065336312d4e5b9ef920db43f77f972be4ce7 (commit)
       via  96e1ff24b57219e6dffbb90cc023e4cf5027a688 (commit)
       via  7862bb5d7eb447f0ae4279d04aedf05bcc254526 (commit)
       via  cb59f805bbc0ce5ea8bdb58eb582d50fdd6de84d (commit)
      from  ecc236fbd1bf2e02ba923072ec1861f17ca0b369 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 9b1fe3dce529c03c56b26b92eadbac1f866ce955
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu May 9 11:44:45 2013 -0600

    introduce scoped cleanups
    
    This adds scoped cleanups to gdb.  A scoped cleanup is a more
    efficient, and checkable, alternative to the common idiom:
    
        cleanup = make_cleanup (null_cleanup, NULL);
        ...
        do_cleanups (cleanup);
    
    ... where the cleanup is always run when exiting the scope.
    
    The efficiency comes from stack allocating the scoped cleanup.  This
    is probably minor.  However, I've noticed myself sometimes avoiding
    null cleanups on this basis, and it is nice to erase that bias.
    
    The checking comes from using a GCC extension when available.  This
    check ensures that the scoped cleanup was either run or discarded when
    the scope exits.

commit 28bbcf20b7b4a0f597237b56a7eb8793c65edbed
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed May 8 14:57:11 2013 -0600

    fix up xml-support.c
    
    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 is not really
    needed, so I removed it.
    
    	* xml-support.c (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.
    	(gdb_xml_parse_quick): Use gdb_xml_create_parser_and_cleanup_1.
    	(xml_process_xincludes): Update.
    	* xml-support.h (gdb_xml_create_parser_and_cleanup): Don't
    	declare.

commit b742ab349892cce15df6d761190d17eb27a23976
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed May 8 14:52:26 2013 -0600

    fix compile_rx_or_error
    
    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.

commit 72b491c4ccd7996cf471b85b346616f207e69760
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 11:57:54 2013 -0600

    some fixes to infrun.c
    
    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 (handle_vfork_child_exec_or_exit)
    	(fetch_inferior_event, adjust_pc_after_break): Introduce
    	an outer null cleanup.

commit f1ed049596b4deed84518830462a7ffbd371979c
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 11:36:46 2013 -0600

    fix breakpoint_1
    
    This is a stylistic change to make breakpoint_1 analyzable.
    
    The issue here is maybe fixable in the analyzer with some work.
    
    	* breakpoint.c (breakpoint_1): Introduce an outer null cleanup.

commit 09983ec5522012abad22c2484ede6d58c346cf26
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 11:34:59 2013 -0600

    introduce dangling_cleanup attribute and change source to use it
    
    Some functions leak cleanups on purpose.  However, these functions
    aren't "constructors" in the cleanup-checker sense, as they do not
    return the cleanup.
    
    This patch adds an attribute that can be used to mark these functions.
    This avoids a bunch of false reports from the checker.
    
    This patch is really a huge hack.  It is basically giving up on
    cleanly checking the use of cleanups.  You can see this most easily by
    noticing that I elected not to have this property propagate through
    the call chain.
    
    Still, I figured I'd see what people thought of this patch.  Without
    it the checker is harder to use, as you must know which functions are
    ignorable.
    
    Maybe some of these are fixable with a bit more thought.
    
    	* ada-lang.c (old_renaming_is_invisible): Use DANGLING_CLEANUP.
    	* breakpoint.c (breakpoint_re_set_default): Use DANGLING_CLEANUP.
    	* c-exp.y (operator_stoken): Use DANGLING_CLEANUP.
    	* coffread.c (coff_locate_sections): Use DANGLING_CLEANUP.
    	* contrib/cleanup_check.py (leaks_cleanup): New global.
    	(note_dangling_cleanup, leaves_dangling_cleanup): New functions.
    	(CleanupChecker.compute_master): Add comment.  Check
    	leaves_dangling_cleanup.
    	(CleanupChecker.check_cleanups): Don't mention special constructors
    	to the user.
    	(register_attributes): New function.  Register it with gcc.
    	* defs.h (DANGLING_CLEANUP): New define.
    	* dwarf2read.c (read_cutu_die_from_dwo, handle_DW_AT_stmt_list)
    	(setup_type_unit_groups, dwarf2_add_field, dwarf2_add_typedef)
    	(dwarf2_add_member_fn, psymtab_include_file_name)
    	(dwarf_decode_lines): Use DANGLING_CLEANUP.
    	* linux-nat.c (linux_child_pid_to_exec_file): Use DANGLING_CLEANUP.
    	* python/py-prettyprint.c (push_dummy_python_frame): Use
    	DANGLING_CLEANUP.
    	* stabsread.c (read_member_functions, read_struct_fields)
    	(read_baseclasses): Use DANGLING_CLEANUP.
    	* utils.h (gdb_bfd_errmsg): Use DANGLING_CLEANUP.

commit c76ac86917cfd5f8d783730da496285ac7d956d2
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 10:55:56 2013 -0600

    fix mi-cmd-var.c
    
    This is a stylistic change in mi-cmd-var.c that adds outer cleanups
    where needed by the checker.
    
    	* mi/mi-cmd-var.c (mi_cmd_var_list_children): Add an outer
    	null cleanup.
    	(mi_cmd_var_update, varobj_update_one): Likewise.

commit cdcd1ee9c3501362c7071ec6b0e818d5ef775809
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 10:54:48 2013 -0600

    fix cli-script.c
    
    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.

commit bb421a989e7dc3696315823b8918092f0ee174c8
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 09:23:12 2013 -0600

    fix mi-cmd-stack.c
    
    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".

commit 6d00e10eddf7b9b5594aedb29d2e2135eb116800
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 09:03:52 2013 -0600

    fix dbxread.c
    
    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.

commit 09f8d24b18b1f4beea87459625e0ce2a6bf03992
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 09:01:51 2013 -0600

    fix source.c
    
    find_and_open_source can leak a cleanup.
    
    	* source.c (find_and_open_source): Call do_cleanups.

commit a0b282774d0e5948ea2655ac2ec496cacea7a9ba
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 08:53:19 2013 -0600

    fix linux-thread-db.c
    
    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.

commit 29862d1dbc5bb0ffb1057fe4775efc0d0c83bdf0
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon May 6 13:47:54 2013 -0600

    fix in solib-aix.c
    
    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.

commit 27ac4476e9e4f7a238ca9f86ec955ef6d2d21c02
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Mar 7 07:43:40 2013 -0700

    use explicit returns to avoid checker confusion
    
    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.

commit 9de1593e2a53e2414bfb06ccd238a2a4adc148be
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:43:27 2013 -0700

    fix cp-namespace.c
    
    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.

commit 22b53119e9c8e26a32ff9300d698725e29cd123c
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:36:21 2013 -0700

    fix top.c
    
    execute_command can leak a cleanup along one return path.
    
    	* top.c (execute_command): Discard 'cleanup_if_error' cleanups.

commit 5bd523b8ded5668a3e8ad94f2951300d4eebcecf
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:33:18 2013 -0700

    fix one bug in stabsread.c
    
    Some code in stabsread.c can return without running cleanups.
    
    	* stabsread.c (read_struct_type): Call do_cleanups along
    	all return paths.

commit 8151eef178cd96ab3106cccaa3afc8ece5b69d71
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:31:14 2013 -0700

    fix mipsread.c
    
    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.

commit 1ebfefe7d65c7532c9e13534b43915d6c0f3661e
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:22:40 2013 -0700

    fix one bug in symfile.c
    
    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.

commit f839ed581f8468feb9294637cf8e8367de36080c
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:21:16 2013 -0700

    fix symtab.c
    
    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'.

commit 0c04640cda1b579c51d4e8025be9202a374f040b
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:13:35 2013 -0700

    fix py-value.c
    
    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.

commit 0567c8d5e10110e8c6590c0b1ca9bcfad6500f49
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:11:25 2013 -0700

    fix py-prettyprint.c
    
    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.

commit 76ff0a4abfd2d95bee57e14b151c26f4ad42e80c
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:10:29 2013 -0700

    fix py-frame.c
    
    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.

commit f5a385fdac093cd96ac660b38a2a9ba199b98044
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:08:39 2013 -0700

    fix py-breakpoint.c
    
    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.

commit ab1481fe59388b02c51c672114261bcb40261ca7
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:05:33 2013 -0700

    simplify cli-logging.c for analysis
    
    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.

commit 4904a5c8b2929216849840bc807a85ea30300176
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:04:14 2013 -0700

    fix varobj.c
    
    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.

commit 568e3554958cb42488bc51f5e2bd8b5cd817803c
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:00:20 2013 -0700

    make a cleanup unconditionally in tracepoint.c
    
    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.

commit 9950c2e4c9891c1b716d6c6d32107ddd7e97c5a5
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 14:08:50 2013 -0700

    fix two buglets in breakpoint.c
    
    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): Call do_cleanups along
    	all return paths.
    	(parse_cmd_to_aexpr): Call do_cleanups earlier.

commit 668178b2c763a59e4651dabd10ee38fdddc37d2a
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 14:07:24 2013 -0700

    fix cleanup handling in macho_symfile_read
    
    macho_symfile_read leaks a cleanup by assigning to 'back_to' too late.
    
    	* machoread.c (macho_symfile_read): Assign first cleanup to
    	'back_to'.

commit b82374f54619bb0d461d91ab5a40365992548976
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 14:05:14 2013 -0700

    fix cleanup handling in m32r_load
    
    m32r_load is missing a call to do_cleanups along one return path.
    
    	* m32r-rom.c (m32r_load): Call do_cleanups at all returns.

commit 9b80994f1e27a03ac3bf3dadfbebf1f7837deb92
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 13:51:53 2013 -0700

    fix list_available_thread_groups
    
    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.

commit a7e8faba7c73d1912025d17f01aa3a9a757d832f
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 13:50:24 2013 -0700

    cleanup fixes for inf-ptrace.c
    
    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.

commit 36cafe4607fda38a06212cbdb7de1723d1da6f57
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 13:49:52 2013 -0700

    cleanup fixes for remote-mips.c
    
    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.

commit 39b5a3293ce43e0a2d1d79633d99bd88e33801e6
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 13:40:05 2013 -0700

    fix up cleanup handling in internal_vproblem
    
    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.

commit f3008ba4857500b99ba46752a25a351b6b4777b8
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 13:33:48 2013 -0700

    fix linespec bug noticed by the checker
    
    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'.

commit 92e6b6a1fe3fd7885440b6980377af3ea3214374
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 13:32:16 2013 -0700

    remove erroneous return from setup_user_args
    
    This fixes setup_user_args to drop a useless and confusing "return".
    
    	* cli/cli-script.c (setup_user_args): Don't return after error.

commit 284f852a6a591eebee8ad7771a6bb9a2c23d6894
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 12:08:32 2013 -0700

    fix cleanup buglet in ada-lang.c
    
    This fixes ada_make_symbol_completion_list not to leak cleanups.
    
    	* ada-lang.c (ada_make_symbol_completion_list): Call do_cleanups.

commit c0ee22e97e7faba76eb25f400bdb3e4c90ca4f40
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 12:04:43 2013 -0700

    fix cleanups in som_symtab_read
    
    This fixes som_symtab_read not to leak cleanups.
    
    	* somread.c (som_symtab_read): Call do_cleanups.

commit b5bf6ca0277ca19092a95363f6d941f388aebb9a
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu May 9 10:30:37 2013 -0600

    fix print_command_1
    
    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.

commit db7f01b90cfe91e8983a96110a63d4fa2c38c598
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 12:02:33 2013 -0700

    some cleanup checker fixes
    
    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.

commit 71e35171076ebf86e6c9317cf02fbbb278e9838f
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 11:31:47 2013 -0700

    add the cleanup checker
    
    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.

commit c96847a6874989b24231a314760776becb458c59
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 11:20:36 2013 -0700

    add README.archer

commit 95615b4a2932c1cbb5e8314afa4f43b1c38a9ee8
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu May 9 06:58:16 2013 +0000

    Use fputc in place of putc to avoid -Wunused-value warning (AIX).
    
    Currently, bfd does not compile with -Wunused-value because
    the following code:
    
            val = putc ('\n', f);
    
    gets expanded into some code that triggers a warning:
    
            warning: value computed is not used [-Wunused-value]
    
    This is because putc is implemented as a macro...
    
    >#define putc(__x, __p)  (((!((__p)->_flag & 0xC000)) && \
    >                        ((__p)->_flag = ((__p)->_flag  & 0x3FFF) | 0x8000)),\
    >                        (--(__p)->_cnt < 0 ? \
    >                        __flsbuf((unsigned char) (__x), (__p)) : \
    >                        (int) (*(__p)->_ptr++ = (unsigned char) (__x))))
    
    It's the first part, before the coma operator, which triggers
    the unused-value warning.
    
    This patch fixes the issue by simply avoiding the macro and using
    fputc instead.
    
    bfd/ChangeLog:
    
            * bfd.c (_bfd_default_error_handler): Replace use of putc
            by fputc.  Add comment explaining why.

commit 485edc33433aae5742e8cc4fbefdeea586dd7623
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu May 9 06:52:21 2013 +0000

    source.c: Use fgetc instead of getc.
    
    On AIX, getc is a macro which triggers an -Wunused-value warning.
    
    gdb/ChangeLog:
    
            * source.c (forward_search_command): Replace call to getc
            by call to fgetc.
            (reverse_search_command): Likewise.

commit 6b0f6001d42f7626cccaf964ce7e218efbc02176
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Thu May 9 04:32:54 2013 +0000

    	* ppc-opc.c (extract_vlesi): Properly sign extend.
    	(extract_vlensi): Likewise.  Comment reason for setting invalid.

commit de8127d5c010f93939533769c6adc6e55cec9630
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Thu May 9 00:00:32 2013 +0000

    *** empty log message ***

commit bf21d1963b2a80db660b586ff2bf5fe372b28268
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Thu May 9 00:00:05 2013 +0000

    daily update

commit 808e8fdc1d868072ed6cd214603d690d93597c31
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Wed May 8 23:31:37 2013 +0000

    	* elflink.c (elf_link_add_object_symbols): Don't omit reading
    	of symbols when hashes already exist.

commit 69258f21f6ff1184208c2d3e1110ababc781bec3
Author: Doug Evans <dje@google.com>
Date:   Wed May 8 22:38:19 2013 +0000

    	* psymtab.c (expand_symtabs_matching_via_partial): Fix file name
    	matching test.

commit fa23708ed5f8249d38948f8d5269bfbbca088417
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed May 8 18:56:02 2013 +0000

    	* gdb.base/solib-search.exp: Set test name for "set
    	solib-search-path" test.

commit 390e57deb940ca7330a27b33d1e89652362295fb
Author: abidh <abidh>
Date:   Wed May 8 16:15:01 2013 +0000

    2013-05-08  Hafiz Abid Qadeer  <abidh@codesourcery.com>
    
    	* gdb.trace/circ.exp: Remove unnecessary 'if then' checks.
    	(set_a_tracepoint): Set tracepoint before prologue.
    	(run_trace_experiment): Test setup_tracepoints and 'break end'
    	in it.
    	(trace_buffer_normal): Remove.
    	(gdb_trace_circular_tests): Remove.  Move tests to...
    	(top level): ...here.  Call 'runto_main' before checking for
    	trace support.  Use commands to check the support for circular
    	trace buffer and changing of trace buffer size.  Add test
    	to calculate size of single frame.  Use this size to
    	calculate the size of trace buffer.  Use 'tfind pc func9'
    	instead of 'tfind 9'.  Use 'with_test_prefix'.

-----------------------------------------------------------------------

Summary of changes:
 COPYING.NEWLIB                                     |   31 +
 ChangeLog                                          |    4 +
 bfd/ChangeLog                                      |   38 +-
 bfd/bfd.c                                          |    4 +-
 bfd/elf-bfd.h                                      |    5 +-
 bfd/elf-ifunc.c                                    |   48 +-
 bfd/elf32-i386.c                                   |    3 +-
 bfd/elf64-x86-64.c                                 |    1 +
 bfd/elflink.c                                      |   17 +-
 bfd/version.h                                      |    2 +-
 gdb/ChangeLog                                      |  219 +++-
 gdb/Makefile.in                                    |    4 +-
 gdb/NEWS                                           |    9 +
 gdb/ada-lang.c                                     |    1 -
 gdb/breakpoint.c                                   |   29 +-
 gdb/cleanups.c                                     |   70 +-
 gdb/cleanups.h                                     |   55 +
 gdb/common/linux-btrace.c                          |   70 +-
 gdb/configure.tgt                                  |   11 +
 gdb/contrib/ari/gdb_ari.sh                         |    6 +-
 gdb/contrib/cleanup_check.py                       |    2 +-
 gdb/dbxread.c                                      |    2 +-
 gdb/doc/ChangeLog                                  |   16 +
 gdb/doc/gdb.texinfo                                |   36 +
 gdb/doc/gdbint.texinfo                             |   71 +
 gdb/dwarf2loc.c                                    |   54 +-
 gdb/dwarf2loc.h                                    |    5 +
 gdb/dwarf2read.c                                   |  169 ++-
 gdb/elfread.c                                      |    4 +-
 gdb/features/Makefile                              |    2 +
 gdb/features/library-list-aix.dtd                  |    4 +-
 gdb/features/nios2-cpu.xml                         |   59 +
 gdb/features/nios2-linux.c                         |   71 +
 gdb/features/nios2-linux.xml                       |   13 +
 gdb/features/nios2.c                               |   69 +
 gdb/features/nios2.xml                             |   12 +
 gdb/gcore.c                                        |    5 +-
 gdb/gdbserver/ChangeLog                            |    9 +
 gdb/gdbserver/Makefile.in                          |    4 +
 gdb/gdbserver/configure.srv                        |    9 +
 gdb/gdbserver/linux-nios2-low.c                    |  234 +++
 gdb/linespec.c                                     |    4 +-
 gdb/machoread.c                                    |    2 +-
 gdb/nios2-linux-tdep.c                             |  233 +++
 gdb/nios2-tdep.c                                   | 1637 ++++++++++++++++++++
 gdb/nios2-tdep.h                                   |   80 +
 gdb/objfiles.c                                     |    5 +-
 gdb/objfiles.h                                     |    2 +-
 gdb/ppc-linux-nat.c                                |   13 +-
 gdb/psymtab.c                                      |   20 +-
 gdb/regformats/nios2-linux.dat                     |   53 +
 gdb/rs6000-nat.c                                   |   14 +-
 gdb/sol-thread.c                                   |   24 +-
 gdb/solib-aix.c                                    |   19 +-
 gdb/solib-dsbt.c                                   |  151 +--
 gdb/solib-svr4.c                                   |    9 +
 gdb/solib.c                                        |   19 +-
 gdb/solist.h                                       |    5 +
 gdb/somread.c                                      |    3 +-
 gdb/source.c                                       |    8 +-
 gdb/stabsread.h                                    |    3 +-
 gdb/symfile.c                                      |   39 +-
 gdb/symfile.h                                      |   18 +-
 gdb/target.h                                       |    2 +-
 gdb/testsuite/ChangeLog                            |   91 ++
 gdb/testsuite/gdb.arch/gcore.c                     |   70 -
 gdb/testsuite/gdb.arch/system-gcore.exp            |  215 ---
 gdb/testsuite/gdb.arch/vsx-regs.exp                |   33 +-
 gdb/testsuite/gdb.base/gcore.exp                   |   34 +-
 gdb/testsuite/gdb.base/pending.exp                 |    3 +
 .../shr2.c => gdb.base/solib-search-lib1.c}        |   43 +-
 .../shr2.c => gdb.base/solib-search-lib2.c}        |   43 +-
 .../shr2.c => gdb.base/solib-search.c}             |   27 +-
 gdb/testsuite/gdb.base/solib-search.exp            |  186 +++
 .../shr2.c => gdb.base/solib-search.h}             |   40 +-
 .../shr2.c => gdb.dwarf2/implptrconst.c}           |   20 +-
 gdb/testsuite/gdb.dwarf2/implptrconst.exp          |  103 ++
 gdb/testsuite/gdb.gdb/complaints.exp               |  126 +--
 gdb/testsuite/gdb.gdb/observer.exp                 |  125 +--
 gdb/testsuite/gdb.gdb/selftest.exp                 |   24 +-
 gdb/testsuite/gdb.gdb/xfullpath.exp                |  125 +--
 gdb/testsuite/gdb.linespec/linespec.exp            |    4 +
 gdb/testsuite/gdb.reverse/{shr2.c => shr.h}        |   24 +-
 gdb/testsuite/gdb.reverse/{shr2.c => shr1.c}       |   20 +-
 gdb/testsuite/gdb.reverse/shr2.c                   |    2 +
 gdb/testsuite/gdb.reverse/solib-precsave.exp       |   59 +-
 gdb/testsuite/gdb.reverse/solib-reverse.c          |   25 +-
 gdb/testsuite/gdb.reverse/solib-reverse.exp        |   59 +-
 gdb/testsuite/gdb.threads/gcore-thread.exp         |   33 +-
 gdb/testsuite/gdb.threads/wp-replication.c         |  163 ++
 gdb/testsuite/gdb.threads/wp-replication.exp       |  151 ++
 gdb/testsuite/gdb.trace/circ.exp                   |  363 +++--
 gdb/testsuite/gdb.xml/tdesc-regs.exp               |    3 +
 gdb/testsuite/lib/dwarf.exp                        |   30 +-
 gdb/testsuite/lib/gdb.exp                          |   43 +
 .../xfullpath.exp => lib/selftest-support.exp}     |  138 +--
 gdb/value.c                                        |   12 +-
 gdb/version.in                                     |    2 +-
 gdb/xcoffread.c                                    |    5 +-
 opcodes/ChangeLog                                  |    5 +
 opcodes/ppc-opc.c                                  |    9 +-
 101 files changed, 4727 insertions(+), 1571 deletions(-)
 create mode 100644 gdb/features/nios2-cpu.xml
 create mode 100644 gdb/features/nios2-linux.c
 create mode 100644 gdb/features/nios2-linux.xml
 create mode 100644 gdb/features/nios2.c
 create mode 100644 gdb/features/nios2.xml
 create mode 100644 gdb/gdbserver/linux-nios2-low.c
 create mode 100644 gdb/nios2-linux-tdep.c
 create mode 100644 gdb/nios2-tdep.c
 create mode 100644 gdb/nios2-tdep.h
 create mode 100644 gdb/regformats/nios2-linux.dat
 delete mode 100644 gdb/testsuite/gdb.arch/gcore.c
 delete mode 100644 gdb/testsuite/gdb.arch/system-gcore.exp
 copy gdb/testsuite/{gdb.reverse/shr2.c => gdb.base/solib-search-lib1.c} (53%)
 copy gdb/testsuite/{gdb.reverse/shr2.c => gdb.base/solib-search-lib2.c} (53%)
 copy gdb/testsuite/{gdb.reverse/shr2.c => gdb.base/solib-search.c} (68%)
 create mode 100644 gdb/testsuite/gdb.base/solib-search.exp
 copy gdb/testsuite/{gdb.reverse/shr2.c => gdb.base/solib-search.h} (58%)
 copy gdb/testsuite/{gdb.reverse/shr2.c => gdb.dwarf2/implptrconst.c} (75%)
 create mode 100644 gdb/testsuite/gdb.dwarf2/implptrconst.exp
 copy gdb/testsuite/gdb.reverse/{shr2.c => shr.h} (74%)
 copy gdb/testsuite/gdb.reverse/{shr2.c => shr1.c} (75%)
 create mode 100644 gdb/testsuite/gdb.threads/wp-replication.c
 create mode 100644 gdb/testsuite/gdb.threads/wp-replication.exp
 copy gdb/testsuite/{gdb.gdb/xfullpath.exp => lib/selftest-support.exp} (55%)

First 500 lines of diff:
diff --git a/COPYING.NEWLIB b/COPYING.NEWLIB
index 6849eb5..73379ff 100644
--- a/COPYING.NEWLIB
+++ b/COPYING.NEWLIB
@@ -894,3 +894,34 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+(40) - Altera Corportion (nios2-* targets)
+
+Copyright (c) 2003 Altera Corporation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+   o Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer. 
+   o Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the 
+     documentation and/or other materials provided with the distribution. 
+   o Neither the name of Altera Corporation nor the names of its 
+     contributors may be used to endorse or promote products derived from
+     this software without specific prior written permission. 
+ 
+THIS SOFTWARE IS PROVIDED BY ALTERA CORPORATION, THE COPYRIGHT HOLDER,
+AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+
diff --git a/ChangeLog b/ChangeLog
index 06c7d47..2d6d310 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* COPYING.NEWLIB: Add Altera Corporation copyright.
+
 2013-04-29  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
 
 	* config.guess: Update from config repo.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f70fa2f..e680c3a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,11 +1,37 @@
+2013-05-09  Joel Brobecker  <brobecker@adacore.com>
+
+	* bfd.c (_bfd_default_error_handler): Replace use of putc
+	by fputc.  Add comment explaining why.
+
+2013-05-09  Alan Modra  <amodra@gmail.com>
+
+	* elflink.c (elf_link_add_object_symbols): Don't omit reading
+	of symbols when hashes already exist.
+
+2013-05-07  Will Newton  <will.newton@linaro.org>
+
+	* elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Add a
+	plt_header_size argument for ports where it differs from
+	plt_entry_size.
+	* elf-bfd.h: Likewise.
+	* elf32-i386.c: Pass plt_header_size to
+	_bfd_elf_allocate_ifunc_dyn_relocs.
+	* elf64-x86-64.c: Likewise.
+
+2013-05-07  Will Newton  <will.newton@linaro.org>
+
+	* elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Remove unused
+	function.
+	* elf-bfd.h: Likewise.
+
 2013-05-06  Paul Brook  <paul@codesourcery.com>
 
-        * elf64-mips.c (elf_mips_gnu_pcrel32): New.
-        (bfd_elf64_bfd_reloc_type_lookup, bfd_elf64_bfd_reloc_name_lookup,
-        mips_elf64_rtype_to_howto): Handle R_MIPS_PC32.
-        * elfn32-mips.c (elf_mips_gnu_pcrel32): New.
-        (bfd_elfn32_bfd_reloc_type_lookup, bfd_elfn32_bfd_reloc_name_lookup,
-        mips_elfn32_rtype_to_howto): Handle R_MIPS_PC32.
+	* elf64-mips.c (elf_mips_gnu_pcrel32): New.
+	(bfd_elf64_bfd_reloc_type_lookup, bfd_elf64_bfd_reloc_name_lookup,
+	mips_elf64_rtype_to_howto): Handle R_MIPS_PC32.
+	* elfn32-mips.c (elf_mips_gnu_pcrel32): New.
+	(bfd_elfn32_bfd_reloc_type_lookup, bfd_elfn32_bfd_reloc_name_lookup,
+	mips_elfn32_rtype_to_howto): Handle R_MIPS_PC32.
 
 2013-05-06  Alan Modra  <amodra@gmail.com>
 
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 10bc319..8d0580c 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -733,7 +733,9 @@ _bfd_default_error_handler (const char *fmt, ...)
   vfprintf (stderr, new_fmt, ap);
   va_end (ap);
 
-  putc ('\n', stderr);
+  /* On AIX, putc is implemented as a macro that triggers a -Wunused-value
+     warning, so use the fputc function to avoid it.  */
+  fputc ('\n', stderr);
   fflush (stderr);
 }
 
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index b643dbc..4a67d02 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2378,12 +2378,9 @@ struct elf_dyn_relocs
 
 extern bfd_boolean _bfd_elf_create_ifunc_sections
   (bfd *, struct bfd_link_info *);
-extern asection * _bfd_elf_create_ifunc_dyn_reloc
-  (bfd *, struct bfd_link_info *, asection *sec, asection *sreloc,
-   struct elf_dyn_relocs **);
 extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs
   (struct bfd_link_info *, struct elf_link_hash_entry *,
-   struct elf_dyn_relocs **, unsigned int, unsigned int);
+   struct elf_dyn_relocs **, unsigned int, unsigned int, unsigned int);
 
 extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *);
 extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *);
diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c
index c2fa163..8d48e66 100644
--- a/bfd/elf-ifunc.c
+++ b/bfd/elf-ifunc.c
@@ -104,51 +104,6 @@ _bfd_elf_create_ifunc_sections (bfd *abfd, struct bfd_link_info *info)
   return TRUE;
 }
 
-/* For a STT_GNU_IFUNC symbol, create a dynamic reloc section, SRELOC,
-   for the input section, SEC, and append this reloc to HEAD.  */
-
-asection *
-_bfd_elf_create_ifunc_dyn_reloc (bfd *abfd, struct bfd_link_info *info,
-				 asection *sec, asection *sreloc,
-				 struct elf_dyn_relocs **head)
-{
-  struct elf_dyn_relocs *p;
-  struct elf_link_hash_table *htab = elf_hash_table (info);
-
-  if (sreloc == NULL)
-    {
-      const struct elf_backend_data *bed = get_elf_backend_data (abfd);
-
-      if (htab->dynobj == NULL)
-	htab->dynobj = abfd;
-
-      sreloc = _bfd_elf_make_dynamic_reloc_section (sec, htab->dynobj,
-						    bed->s->log_file_align,
-						    abfd,
-						    bed->rela_plts_and_copies_p);
-      if (sreloc == NULL)
-	return NULL;
-    }
-
-  p = *head;
-  if (p == NULL || p->sec != sec)
-    {
-      bfd_size_type amt = sizeof *p;
-
-      p = ((struct elf_dyn_relocs *) bfd_alloc (htab->dynobj, amt));
-      if (p == NULL)
-	return NULL;
-      p->next = *head;
-      *head = p;
-      p->sec = sec;
-      p->count = 0;
-      p->pc_count = 0;
-    }
-  p->count += 1;
-
-  return sreloc;
-}
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs against a STT_GNU_IFUNC symbol definition.  */
 
@@ -157,6 +112,7 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
 				    struct elf_link_hash_entry *h,
 				    struct elf_dyn_relocs **head,
 				    unsigned int plt_entry_size,
+				    unsigned int plt_header_size,
 				    unsigned int got_entry_size)
 {
   asection *plt, *gotplt, *relplt;
@@ -238,7 +194,7 @@ keep:
       /* If this is the first .plt entry, make room for the special
 	 first entry.  */
       if (plt->size == 0)
-	plt->size += plt_entry_size;
+	plt->size += plt_header_size;
     }
   else
     {
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 2609130..cc8b48e 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2197,7 +2197,8 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
   if (h->type == STT_GNU_IFUNC
       && h->def_regular)
     return _bfd_elf_allocate_ifunc_dyn_relocs (info, h, &eh->dyn_relocs,
-                                               plt_entry_size, 4);
+                                               plt_entry_size,
+					       plt_entry_size, 4);
   else if (htab->elf.dynamic_sections_created
 	   && h->plt.refcount > 0)
     {
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 9adc959..758231e 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2260,6 +2260,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
     return _bfd_elf_allocate_ifunc_dyn_relocs (info, h,
 					       &eh->dyn_relocs,
 					       plt_entry_size,
+					       plt_entry_size,
 					       GOT_ENTRY_SIZE);
   else if (htab->elf.dynamic_sections_created
 	   && h->plt.refcount > 0)
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 43c54fc..34bbcd5 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -3699,20 +3699,23 @@ error_free_dyn:
     }
 
   sym_hash = elf_sym_hashes (abfd);
-  if (sym_hash == NULL && extsymcount != 0)
+  if (extsymcount != 0)
     {
       isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff,
 				      NULL, NULL, NULL);
       if (isymbuf == NULL)
 	goto error_return;
 
-      /* We store a pointer to the hash table entry for each external
-	 symbol.  */
-      amt = extsymcount * sizeof (struct elf_link_hash_entry *);
-      sym_hash = (struct elf_link_hash_entry **) bfd_zalloc (abfd, amt);
       if (sym_hash == NULL)
-	goto error_free_sym;
-      elf_sym_hashes (abfd) = sym_hash;
+	{
+	  /* We store a pointer to the hash table entry for each
+	     external symbol.  */
+	  amt = extsymcount * sizeof (struct elf_link_hash_entry *);
+	  sym_hash = (struct elf_link_hash_entry **) bfd_zalloc (abfd, amt);
+	  if (sym_hash == NULL)
+	    goto error_free_sym;
+	  elf_sym_hashes (abfd) = sym_hash;
+	}
     }
 
   if (dynamic)
diff --git a/bfd/version.h b/bfd/version.h
index b93c658..4cb9d1f 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20130506
+#define BFD_VERSION_DATE 20130509
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0e8820e..2d1e3e1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,206 @@
+2013-05-09  Joel Brobecker  <brobecker@adacore.com>
+
+	* source.c (forward_search_command): Replace call to getc
+	by call to fgetc.
+	(reverse_search_command): Likewise.
+
+2013-05-08  Doug Evans  <dje@google.com>
+
+	* psymtab.c (expand_symtabs_matching_via_partial): Fix file name
+	matching test.
+
+2013-05-08  Joel Brobecker  <brobecker@adacore.com>
+
+	* sol-thread.c (info_cb): Factorize the code a little.
+
+2013-05-08  Joel Brobecker  <brobecker@adacore.com>
+
+	* sol-thread.c (info_cb): Rework the output of the "maintenance
+	info sol-threads" command a bit.
+
+2013-05-08  Joel Brobecker  <brobecker@adacore.com>
+
+	* sol-thread.c (info_cb) [ti.ti_state == TD_THR_SLEEP]:
+	Replace ti.ti_startfunc by ti.ti_pc.
+
+2013-05-08  Joel Brobecker  <brobecker@adacore.com>
+
+	* solib-aix.c (solib_aix_free_library_list): New function
+	for the case where HAVE_LIBEXPAT is not defined.
+
+2013-05-07  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+	PR breakpoints/15413:
+	* breakpoint.c (condition_completer): Simplify the code to
+	disconsider multiple locations of breakpoints when completing the
+	"condition" command.
+
+2013-05-07  Pierre Muller  <muller@sourceware.org>
+
+	* common/linux-btrace.c: ARI fix: Include "gdb_wait.h"
+	instead of <sys/wait.h>.
+
+2013-05-07  Pierre Muller  <muller@sourceware.org>
+
+	* nios2-tdep.c (nios2_dwarf_reg_to_regnum): ARI fix: remove
+	trailing new line from warning message.
+
+2013-05-07  Pierre Muller  <muller@sourceware.org>
+
+	* contrib/ari/gdb_ari.sh (SOLIB_ADD, SOLIB_CREATE_INFERIOR_HOOK)
+	(PC_SOLIB): Change type from ari_deprecate to ari_regression.
+
+2013-05-07  Joel Brobecker  <brobecker@adacore.com>
+
+	* rs6000-nat.c (rs6000_core_ldinfo): Remove '\n' at end of
+	error message (ARI fix).
+
+2013-05-07  Joel Brobecker  <brobecker@adacore.com>
+
+	* features/library-list-aix.dtd: Replace library-list by
+	library-list-aix.
+	* rs6000-nat.c: Replace library-list by library-list-aix
+	throughout.
+	* solib-aix.c: Likewise.
+
+2013-05-07  Joel Brobecker  <brobecker@adacore.com>
+
+	* target.h (enum target_object) [TARGET_OBJECT_LIBRARIES_AIX]:
+	Renames TARGET_OBJECT_AIX_LIBRARIES.
+	* rs6000-nat.c: Replace TARGET_OBJECT_AIX_LIBRARIES with
+	TARGET_OBJECT_LIBRARIES_AIX throughout.
+	* solib-aix.c: Likwise.
+
+2013-05-07  Yao Qi  <yao@codesourcery.com>
+
+	* solib-dsbt.c (struct dsbt_info) <enable_break2_done>: Remove.
+	(get_dsbt_info, enable_break, dsbt_clear_solib): Update.
+
+2013-05-07  Yao Qi  <yao@codesourcery.com>
+
+	* solib-dsbt.c (enable_break): Declare.
+	(dsbt_current_sos): Remove call to enable_break2.
+	(enable_break2): Rename to enable_break.  Set solib breakpoint
+	on '_dl_debug_state'.
+	(enable_break): Remove.
+
+2013-05-07  Luis Machado  <lgustavo@codesourcery.com>
+
+	* ppc-linux-nat.c (ppc_linux_new_thread): Clear the new thread's
+	debug state prior to replicating existing hardware watchpoints or
+	breakpoints.
+
+2013-05-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* gcore.c (gcore_create_callback): Ignore sections with
+	separate_debug_objfile_backlink != NULL.
+
+2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
+	    Andrew Jenner  <andrew@codesourcery.com>
+	    Chung-Lin Tang  <cltang@codesourcery.com>
+	    Julian Brown  <julian@codesourcery.com>
+
+	Based on the nios2-elf port from Altera Corporation.
+
+	* Makefile.in (ALL_TARGET_OBS): Add nios2-tdep.o and
+	nios2-linux-tdep.o.
+	(HFILES_NO_SRCDIR): Add nios2-tdep.h.
+	(ALLDEPFILES): Add nios2-tdep.c and nios2-linux-tdep.c.
+	* configure.tgt: Add nios2*-*-linux* and nios2*-*-* targets.
+	* nios2-tdep.h: New.
+	* nios2-tdep.c: New.
+	* nios2-linux-tdep.c: New.
+	* features/Makefile (WHICH): Add nios2-linux.
+	(nios2-linux-expedite): Set.
+	* features/nios2-cpu.xml: New.
+	* features/nios2.xml: New.
+	* features/nios2-linux.xml: New.
+	* features/nios2.c: New (autogenerated).
+	* features/nios2-linux.c: New (autogenerated).
+	* regformats/nios2-linux.dat: New (autogenerated).
+	* NEWS (Changes since GDB 7.6): Add new Nios II targets
+	and commands.
+
+2013-05-06  Doug Evans  <dje@google.com>
+
+	* symfile.c: Whitespace cleanup.
+
+	* solist.h (struct target_so_ops): New member clear_so.
+	* solib-svr4.c (svr4_clear_so): New function.
+	(_initialize_svr4_solib): Set svr4_so_ops.clear_so.
+	* solib.c (clear_so): Renamed from free_so_symbols.
+	All callers updated.  Call target clear_so if it exists.
+
+2013-05-06  Tom Tromey  <tromey@redhat.com>
+
+	* ada-lang.c (ada_value_primitive_packed_val): Don't
+	call value_incref.
+	* value.c (set_value_parent): Incref the new parent and decref
+	the old parent.
+	(value_copy, value_primitive_field): Use set_value_parent.
+
+2013-05-06  Tom Tromey  <tromey@redhat.com>
+
+	* dwarf2loc.c (invalid_synthetic_pointer): Move earlier.
+	(indirect_pieced_value): Call dwarf2_fetch_constant_bytes
+	if needed.
+	* dwarf2loc.h (dwarf2_fetch_constant_bytes): Declare.
+	* dwarf2read.c (write_constant_as_bytes)
+	(dwarf2_fetch_constant_bytes): New functions.
+
+2013-05-06  Tom Tromey  <tromey@redhat.com>
+
+	* dwarf2read.c (dwarf2_const_value_data): Remove unused
+	parameters.
+	(dwarf2_const_value_attr): Update.
+
+2013-05-06  Tom Tromey  <tromey@redhat.com>
+
+	* somread.c (som_symfile_offsets): Add 'const' to addrs.
+	* machoread.c (macho_symfile_offsets): Add 'const' to addrs.
+	* xcoffread.c (xcoff_symfile_offsets): Add 'const' to addrs.
+	Remove declaration.
+
+2013-05-06  Tom Tromey  <tromey@redhat.com>
+
+	* dwarf2read.c (dwarf2_const_value_attr): Use 'obstack', not
+	objfile's obstack.
+
+2013-05-06  Doug Evans  <dje@google.com>
+
+	* dbxread.c (process_one_symbol): Constify section_offsets parameter.
+	* stabsread.h (process_one_symbol): Update declaration.
+	* dwarf2read.c (dw2_relocate): Constify new_offsets, delta parameters.
+	* elfread.c (elf_symfile_relocate_probe): Ditto.
+	* psymtab.c (relocate_psymtabs): Ditto.
+	* objfiles.c (objfile_relocate1): Constify new_offsets parameter.
+	(objfile_relocate): Ditto.
+	* objfiles.h (objfile_relocate): Update declaration.
+	* symfile.c (relative_addr_info_to_section_offsets): Constify
+	addrs parameter.
+	(default_symfile_offsets): Ditto.
+	(syms_from_objfile_1): Constify offsets parameter.
+	(syms_from_objfile): Ditto.
+	(symbol_file_add_with_addrs_or_offsets): Ditto.
+	(symfile_map_offsets_to_segments): Constify data parameter.
+	* symfile.h (struct quick_symbol_functions): Constify new_offsets,
+	delta parameters of member relocate.
+	(struct sym_probe_fns): Constify new_offsets,
+	delta parameters of member sym_relocate_probe.
+	(struct sym_fns): Constify section_addr_info parameter of member
+	sym_offsets.
+	(relative_addr_info_to_section_offsets): Update declaration.
+	(default_symfile_offsets): Ditto.
+	(syms_from_objfile): Ditto.
+	(symfile_map_offsets_to_segments): Ditto.
+
+	* symfile.c (syms_from_objfile_1): Use correct section count when
+	objfile->sf == NULL.
+
+2013-05-06  Mike Frysinger  <vapier@gentoo.org>
+
+	* common/linux-btrace.c (intel_supports_btrace): Fix indentation.
+
 2013-05-06  Doug Evans  <dje@google.com>
 
 	* psympriv.h (struct partial_symtab): Augment comment for member
@@ -1148,7 +1351,7 @@
 	(_initialize_ctf): New.
 	* tracepoint.c (get_tracepoint_number): New
 	(get_uploaded_tsv): Remove 'static'.
- 	(struct traceframe_info, trace_regblock_size): Move it to ...
+	(struct traceframe_info, trace_regblock_size): Move it to ...
 	* tracepoint.h: ... here.
 	(get_tracepoint_number): Declare it.
 	(get_uploaded_tsv): Declare it.
@@ -2550,11 +2753,11 @@
 
 2013-03-12  Paul Hilfinger  <hilfingr@adacore.com>
 


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [SCM]  tromey/cleanup-checker: introduce scoped cleanups
@ 2013-05-14 20:42 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2013-05-14 20:42 UTC (permalink / raw)
  To: archer-commits

The branch, tromey/cleanup-checker has been updated
  discards  212f7dae72349005357393d8c3b80e88c2e2c46b (commit)
       via  8a08c1b0d1feef7543005325d453a9efdcb4b7dc (commit)
      from  212f7dae72349005357393d8c3b80e88c2e2c46b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 8a08c1b0d1feef7543005325d453a9efdcb4b7dc
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu May 9 11:44:45 2013 -0600

    introduce scoped cleanups
    
    This adds scoped cleanups to gdb.  A scoped cleanup is a more
    efficient, and checkable, alternative to the common idiom:
    
        cleanup = make_cleanup (null_cleanup, NULL);
        ...
        do_cleanups (cleanup);
    
    ... where the cleanup is always run when exiting the scope.
    
    The efficiency comes from stack allocating the scoped cleanup.  This
    is probably minor.  However, I've noticed myself sometimes avoiding
    null cleanups on this basis, and it is nice to erase that bias.
    
    The checking comes from using a GCC extension when available.  This
    check ensures that the scoped cleanup was either run or discarded when
    the scope exits.

-----------------------------------------------------------------------

Summary of changes:
 gdb/cleanups.c |    6 ++++--
 gdb/cleanups.h |    4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

First 500 lines of diff:
diff --git a/gdb/cleanups.c b/gdb/cleanups.c
index 76d28c4..6d6d78c 100644
--- a/gdb/cleanups.c
+++ b/gdb/cleanups.c
@@ -324,13 +324,15 @@ init_scoped_cleanup (struct scoped_cleanup *cl)
   return old_chain;
 }
 
+#ifdef SCOPED_CLEANUP_CHECKING
+
 /* Verify that a scoped cleanup was in fact handled.  */
 
 void
 cleanup_close_scope (struct scoped_cleanup *cl)
 {
-#ifdef SCOPED_CLEANUP_CHECKING
   if (!cl->base.cleaned_up)
     internal_warning (__FILE__, __LINE__, "scoped cleanup leaked");
-#endif /* SCOPED_CLEANUP_CHECKING */
 }
+
+#endif /* SCOPED_CLEANUP_CHECKING */
diff --git a/gdb/cleanups.h b/gdb/cleanups.h
index 9f8cbd4..e16a9fa 100644
--- a/gdb/cleanups.h
+++ b/gdb/cleanups.h
@@ -94,8 +94,6 @@ struct scoped_cleanup
 
 extern struct cleanup *init_scoped_cleanup (struct scoped_cleanup *);
 
-extern void cleanup_close_scope (struct scoped_cleanup *);
-
 #if defined (__GNUC__) && __GNUC__ >= 4
 
 /* Define this to consolidate #if checking with the
@@ -106,6 +104,8 @@ extern void cleanup_close_scope (struct scoped_cleanup *);
 #define SCOPED_CLEANUP_ATTRIBUTE \
   __attribute__ ((cleanup (cleanup_close_scope)))
 
+extern void cleanup_close_scope (struct scoped_cleanup *);
+
 #else
 
 #define SCOPED_CLEANUP_ATTRIBUTE


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [SCM]  tromey/cleanup-checker: introduce scoped cleanups
@ 2013-05-13 17:45 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2013-05-13 17:45 UTC (permalink / raw)
  To: archer-commits

The branch, tromey/cleanup-checker has been updated
  discards  9b1fe3dce529c03c56b26b92eadbac1f866ce955 (commit)
  discards  28bbcf20b7b4a0f597237b56a7eb8793c65edbed (commit)
  discards  b742ab349892cce15df6d761190d17eb27a23976 (commit)
  discards  72b491c4ccd7996cf471b85b346616f207e69760 (commit)
  discards  f1ed049596b4deed84518830462a7ffbd371979c (commit)
  discards  09983ec5522012abad22c2484ede6d58c346cf26 (commit)
  discards  c76ac86917cfd5f8d783730da496285ac7d956d2 (commit)
  discards  cdcd1ee9c3501362c7071ec6b0e818d5ef775809 (commit)
  discards  bb421a989e7dc3696315823b8918092f0ee174c8 (commit)
  discards  6d00e10eddf7b9b5594aedb29d2e2135eb116800 (commit)
  discards  09f8d24b18b1f4beea87459625e0ce2a6bf03992 (commit)
  discards  a0b282774d0e5948ea2655ac2ec496cacea7a9ba (commit)
  discards  29862d1dbc5bb0ffb1057fe4775efc0d0c83bdf0 (commit)
  discards  27ac4476e9e4f7a238ca9f86ec955ef6d2d21c02 (commit)
  discards  9de1593e2a53e2414bfb06ccd238a2a4adc148be (commit)
  discards  22b53119e9c8e26a32ff9300d698725e29cd123c (commit)
  discards  5bd523b8ded5668a3e8ad94f2951300d4eebcecf (commit)
  discards  8151eef178cd96ab3106cccaa3afc8ece5b69d71 (commit)
  discards  1ebfefe7d65c7532c9e13534b43915d6c0f3661e (commit)
  discards  f839ed581f8468feb9294637cf8e8367de36080c (commit)
  discards  0c04640cda1b579c51d4e8025be9202a374f040b (commit)
  discards  0567c8d5e10110e8c6590c0b1ca9bcfad6500f49 (commit)
  discards  76ff0a4abfd2d95bee57e14b151c26f4ad42e80c (commit)
  discards  f5a385fdac093cd96ac660b38a2a9ba199b98044 (commit)
  discards  ab1481fe59388b02c51c672114261bcb40261ca7 (commit)
  discards  4904a5c8b2929216849840bc807a85ea30300176 (commit)
  discards  568e3554958cb42488bc51f5e2bd8b5cd817803c (commit)
  discards  9950c2e4c9891c1b716d6c6d32107ddd7e97c5a5 (commit)
       via  212f7dae72349005357393d8c3b80e88c2e2c46b (commit)
       via  ac28d0b42cadec26606c351c4dc0da64b4ad7cc9 (commit)
       via  e13ea91044ecb6b7e11ef6a0948a6344ffd74c7b (commit)
       via  b5934aa76217694c13b6942ceb8cdc1347b3fe90 (commit)
       via  b908d1f6d6bb9abe29ae0d51b50590ef2b05b2a8 (commit)
       via  62c38fe0b1ff8bf404a80e3fdcaf7674447342d5 (commit)
       via  68aa964f224cd625de302c7a92cf04002ced6011 (commit)
       via  3126887c2a009b84551f6928146274eb257d299c (commit)
       via  1b6aab822d8534f9aa988c4a6decebbbc7cc9682 (commit)
       via  cd87ddaa4a8f00efdda393d1e46c97026061c60f (commit)
       via  0e4714eb136cb739e765b48bf92577f4d97a845f (commit)
       via  0045f22ad9b72875d5ac8cea97490ae0d0cd5e9b (commit)
       via  afc715666e5fa331f966e3039b0c235155ce1277 (commit)
       via  d8eab1fc5ef85749c7323128f719c9f7f6d62a66 (commit)
       via  2d3e0116baaa0352c711db1cbb2149a40c84fd48 (commit)
       via  f3940903f9784069c2b7291830fd1a5d05bc595e (commit)
       via  d2a26c8f60250b73c0af1dc69afd7e24d07709f5 (commit)
       via  19ad7176bb73d31dcf94ec0c73739b2d3d906719 (commit)
       via  41aceedec390eee91fc7ea6cb64ab83c88ae7f2a (commit)
       via  581961da08a63cfee0d973a33ef7faa3c87b143f (commit)
       via  84e0e8372df7f377bb9352ea0412ce8412459cc1 (commit)
       via  4325d09461e89376402d4c594c34d4d51ee54eb2 (commit)
       via  a737657e27e1595d5b04bdbbd772be1b7a746696 (commit)
       via  cd06d044eb69a3e50650744f950179eeed15e3b6 (commit)
       via  8aaa4bff619497e49e8a61a54df0b7f82779bdaa (commit)
       via  3b154a472ffac9cea9c09221ece6af9e77b31625 (commit)
       via  4fa96e4172912d0b76468717cc3571bed32dd2cd (commit)
       via  7c03920f78b234c426fdb1307a8035b268d21562 (commit)
      from  9b1fe3dce529c03c56b26b92eadbac1f866ce955 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 212f7dae72349005357393d8c3b80e88c2e2c46b
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu May 9 11:44:45 2013 -0600

    introduce scoped cleanups
    
    This adds scoped cleanups to gdb.  A scoped cleanup is a more
    efficient, and checkable, alternative to the common idiom:
    
        cleanup = make_cleanup (null_cleanup, NULL);
        ...
        do_cleanups (cleanup);
    
    ... where the cleanup is always run when exiting the scope.
    
    The efficiency comes from stack allocating the scoped cleanup.  This
    is probably minor.  However, I've noticed myself sometimes avoiding
    null cleanups on this basis, and it is nice to erase that bias.
    
    The checking comes from using a GCC extension when available.  This
    check ensures that the scoped cleanup was either run or discarded when
    the scope exits.

commit ac28d0b42cadec26606c351c4dc0da64b4ad7cc9
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed May 8 14:57:11 2013 -0600

    fix up xml-support.c
    
    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 is not really
    needed, so I removed it.
    
    	* xml-support.c (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.
    	(gdb_xml_parse_quick): Use gdb_xml_create_parser_and_cleanup_1.
    	(xml_process_xincludes): Update.
    	* xml-support.h (gdb_xml_create_parser_and_cleanup): Don't
    	declare.

commit e13ea91044ecb6b7e11ef6a0948a6344ffd74c7b
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed May 8 14:52:26 2013 -0600

    fix compile_rx_or_error
    
    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.

commit b5934aa76217694c13b6942ceb8cdc1347b3fe90
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 11:57:54 2013 -0600

    some fixes to infrun.c
    
    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 (handle_vfork_child_exec_or_exit)
    	(fetch_inferior_event, adjust_pc_after_break): Introduce
    	an outer null cleanup.

commit b908d1f6d6bb9abe29ae0d51b50590ef2b05b2a8
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 11:36:46 2013 -0600

    fix breakpoint_1
    
    This is a stylistic change to make breakpoint_1 analyzable.
    
    The issue here is maybe fixable in the analyzer with some work.
    
    	* breakpoint.c (breakpoint_1): Introduce an outer null cleanup.

commit 62c38fe0b1ff8bf404a80e3fdcaf7674447342d5
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 11:34:59 2013 -0600

    introduce dangling_cleanup attribute and change source to use it
    
    Some functions leak cleanups on purpose.  However, these functions
    aren't "constructors" in the cleanup-checker sense, as they do not
    return the cleanup.
    
    This patch adds an attribute that can be used to mark these functions.
    This avoids a bunch of false reports from the checker.
    
    This patch is really a huge hack.  It is basically giving up on
    cleanly checking the use of cleanups.  You can see this most easily by
    noticing that I elected not to have this property propagate through
    the call chain.
    
    Still, I figured I'd see what people thought of this patch.  Without
    it the checker is harder to use, as you must know which functions are
    ignorable.
    
    Maybe some of these are fixable with a bit more thought.
    
    	* ada-lang.c (old_renaming_is_invisible): Use DANGLING_CLEANUP.
    	* breakpoint.c (breakpoint_re_set_default): Use DANGLING_CLEANUP.
    	* c-exp.y (operator_stoken): Use DANGLING_CLEANUP.
    	* coffread.c (coff_locate_sections): Use DANGLING_CLEANUP.
    	* contrib/cleanup_check.py (leaks_cleanup): New global.
    	(note_dangling_cleanup, leaves_dangling_cleanup): New functions.
    	(CleanupChecker.compute_master): Add comment.  Check
    	leaves_dangling_cleanup.
    	(CleanupChecker.check_cleanups): Don't mention special constructors
    	to the user.
    	(register_attributes): New function.  Register it with gcc.
    	* defs.h (DANGLING_CLEANUP): New define.
    	* dwarf2read.c (read_cutu_die_from_dwo, handle_DW_AT_stmt_list)
    	(setup_type_unit_groups, dwarf2_add_field, dwarf2_add_typedef)
    	(dwarf2_add_member_fn, psymtab_include_file_name)
    	(dwarf_decode_lines): Use DANGLING_CLEANUP.
    	* linux-nat.c (linux_child_pid_to_exec_file): Use DANGLING_CLEANUP.
    	* python/py-prettyprint.c (push_dummy_python_frame): Use
    	DANGLING_CLEANUP.
    	* stabsread.c (read_member_functions, read_struct_fields)
    	(read_baseclasses): Use DANGLING_CLEANUP.
    	* utils.h (gdb_bfd_errmsg): Use DANGLING_CLEANUP.

commit 68aa964f224cd625de302c7a92cf04002ced6011
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 10:55:56 2013 -0600

    fix mi-cmd-var.c
    
    This is a stylistic change in mi-cmd-var.c that adds outer cleanups
    where needed by the checker.
    
    	* mi/mi-cmd-var.c (mi_cmd_var_list_children): Add an outer
    	null cleanup.
    	(mi_cmd_var_update, varobj_update_one): Likewise.

commit 3126887c2a009b84551f6928146274eb257d299c
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 10:54:48 2013 -0600

    fix cli-script.c
    
    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.

commit 1b6aab822d8534f9aa988c4a6decebbbc7cc9682
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 09:23:12 2013 -0600

    fix mi-cmd-stack.c
    
    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".

commit cd87ddaa4a8f00efdda393d1e46c97026061c60f
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 09:03:52 2013 -0600

    fix dbxread.c
    
    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.

commit 0e4714eb136cb739e765b48bf92577f4d97a845f
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 09:01:51 2013 -0600

    fix source.c
    
    find_and_open_source can leak a cleanup.
    
    	* source.c (find_and_open_source): Call do_cleanups.

commit 0045f22ad9b72875d5ac8cea97490ae0d0cd5e9b
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue May 7 08:53:19 2013 -0600

    fix linux-thread-db.c
    
    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.

commit afc715666e5fa331f966e3039b0c235155ce1277
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon May 6 13:47:54 2013 -0600

    fix in solib-aix.c
    
    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.

commit d8eab1fc5ef85749c7323128f719c9f7f6d62a66
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Mar 7 07:43:40 2013 -0700

    use explicit returns to avoid checker confusion
    
    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.

commit 2d3e0116baaa0352c711db1cbb2149a40c84fd48
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:43:27 2013 -0700

    fix cp-namespace.c
    
    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.

commit f3940903f9784069c2b7291830fd1a5d05bc595e
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:36:21 2013 -0700

    fix top.c
    
    execute_command can leak a cleanup along one return path.
    
    	* top.c (execute_command): Discard 'cleanup_if_error' cleanups.

commit d2a26c8f60250b73c0af1dc69afd7e24d07709f5
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:33:18 2013 -0700

    fix one bug in stabsread.c
    
    Some code in stabsread.c can return without running cleanups.
    
    	* stabsread.c (read_struct_type): Call do_cleanups along
    	all return paths.

commit 19ad7176bb73d31dcf94ec0c73739b2d3d906719
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:31:14 2013 -0700

    fix mipsread.c
    
    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.

commit 41aceedec390eee91fc7ea6cb64ab83c88ae7f2a
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:22:40 2013 -0700

    fix one bug in symfile.c
    
    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.

commit 581961da08a63cfee0d973a33ef7faa3c87b143f
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:21:16 2013 -0700

    fix symtab.c
    
    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'.

commit 84e0e8372df7f377bb9352ea0412ce8412459cc1
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:13:35 2013 -0700

    fix py-value.c
    
    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.

commit 4325d09461e89376402d4c594c34d4d51ee54eb2
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:11:25 2013 -0700

    fix py-prettyprint.c
    
    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.

commit a737657e27e1595d5b04bdbbd772be1b7a746696
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:10:29 2013 -0700

    fix py-frame.c
    
    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.

commit cd06d044eb69a3e50650744f950179eeed15e3b6
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:08:39 2013 -0700

    fix py-breakpoint.c
    
    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.

commit 8aaa4bff619497e49e8a61a54df0b7f82779bdaa
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:05:33 2013 -0700

    simplify cli-logging.c for analysis
    
    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.

commit 3b154a472ffac9cea9c09221ece6af9e77b31625
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:04:14 2013 -0700

    fix varobj.c
    
    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.

commit 4fa96e4172912d0b76468717cc3571bed32dd2cd
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Mar 5 14:00:20 2013 -0700

    make a cleanup unconditionally in tracepoint.c
    
    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.

commit 7c03920f78b234c426fdb1307a8035b268d21562
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Mar 4 14:08:50 2013 -0700

    fix two buglets in breakpoint.c
    
    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.

-----------------------------------------------------------------------

Summary of changes:
 gdb/breakpoint.c |   10 ++++------
 gdb/utils.c      |    2 ++
 2 files changed, 6 insertions(+), 6 deletions(-)

First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index a9f1921..47539f1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5805,8 +5805,7 @@ output_thread_groups (struct ui_out *uiout,
 		      VEC(int) *inf_num,
 		      int mi_only)
 {
-  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
-								field_name);
+  struct cleanup *back_to;
   int is_mi = ui_out_is_mi_like_p (uiout);
   int inf;
   int i;
@@ -5814,10 +5813,9 @@ output_thread_groups (struct ui_out *uiout,
   /* For backward compatibility, don't display inferiors in CLI unless
      there are several.  Always display them for MI. */
   if (!is_mi && mi_only)
-    {
-      do_cleanups (back_to);
-      return;
-    }
+    return;
+
+  back_to = make_cleanup_ui_out_list_begin_end (uiout, field_name);
 
   for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
     {
diff --git a/gdb/utils.c b/gdb/utils.c
index fa54e10..18ee9bb 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1135,6 +1135,8 @@ compile_rx_or_error (regex_t *pattern, const char *rx, const char *message)
 {
   int code;
 
+  gdb_assert (rx != NULL);
+
   code = regcomp (pattern, rx, REG_NOSUB);
   if (code != 0)
     {


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-14 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-09 17:56 [SCM] tromey/cleanup-checker: introduce scoped cleanups tromey
2013-05-13 17:45 tromey
2013-05-14 20:42 tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).