From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11173 invoked by alias); 30 May 2013 14:23:23 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 11154 invoked by uid 306); 30 May 2013 14:23:23 -0000 Date: Thu, 30 May 2013 14:23:00 -0000 Message-ID: <20130530142322.10899.qmail@sourceware.org> From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] tromey/cleanup-checker: introduce dangling_cleanup attribute and change source to use it X-Git-Refname: refs/heads/tromey/cleanup-checker X-Git-Reftype: branch X-Git-Oldrev: 5dff075c4c32032ec8e7f9be971fae85704a57b8 X-Git-Newrev: f26e60871e12e8ba7651cf88cb402200f8226d16 X-SW-Source: 2013-q2/txt/msg00087.txt.bz2 List-Id: The branch, tromey/cleanup-checker has been updated discards 5dff075c4c32032ec8e7f9be971fae85704a57b8 (commit) discards d0cc19c575ceed4d38fa10533aaea29fea602e63 (commit) discards 1d4ff4f4201e491cf8b229df0c66ca7abd4dfb2e (commit) discards 1f4b2f9a2f4a8d1ac3de78a856923cebe51bdc76 (commit) discards 34746973a5ba4e36723df5fde3cc26fd793a57a9 (commit) discards c494ef293b56ea603bfa3afbc186b9dc8a59a7c2 (commit) discards f20f49258f17af6caba82d6f0a3a50180835571f (commit) discards 3c80a3520156141ba16416bb9073848c87387f28 (commit) discards dfc6c5277fa3dacfe6c9b1f69b00c767d9b2e595 (commit) discards dad8a21166e083121eb485a77b873f3ddeab42a6 (commit) discards 17b829498d92873084d1d5d2f7621aa798cf0782 (commit) discards 5643e7d10c0f5494a08673795a6074dc0c7f214f (commit) discards 149348747db59898209d195c5b65f0af9e3f5ee6 (commit) discards 41abc5022f5822168de9e1561034ccc02dc888c2 (commit) discards 23e76c3f554cd9259c4cfb822f1b3d5195f61b59 (commit) discards 2da920f7bbb70cd320ec8717e1f52f0b3a9ed3f1 (commit) discards 6cda6683baa0b6a2e7ec84397ab5efb7c10fa49e (commit) discards 2d1853543c2b3ae07d7443563ed9177a0ae44466 (commit) discards 016807462b453627191e61bedb335342b85479a6 (commit) discards b2f26fb1659f4956ecdb39a858ff5a921f7c6b27 (commit) discards 770fc7a0562c805c6aee0b368fa2c903356679af (commit) discards 3d27f67c018ad861ab1cc1873a2479697621439b (commit) discards 5fbc877b5b1ba2d02f13ffd1cec88c235efc73ac (commit) discards a2b322373dfdf31d72238a6030786414b40fe2bc (commit) discards 16b2d9546251585f556a320ba72622184cd47645 (commit) discards 8ee06c018224e3bc10097fbad49c1dffd001ff40 (commit) discards 26ef109cfd214b6cdb72247ed8191d888ebea4ad (commit) discards 2d09254e64c89a90cabde961da769d849eae44c9 (commit) discards c4c20af4f698687016c5e2eb8889e7f3c603e2b2 (commit) discards c23ae0b8f972073ffde6990ce2ae2497b101bb96 (commit) discards b55417f4656d9000fbb9fdde34ff0c3c5d0bd378 (commit) discards 734a7aa17709f5e86b4d213a32de374ddd286d6e (commit) discards 7cc409a26a8c92de1eeb9f03661848f4c32cf628 (commit) discards d154b8bcd46ab7db6bf23399783297f80af1a21f (commit) discards c771602adbe1975050ea1cbd23255ef555ea0562 (commit) discards 02c275e3d25d04da6cfb72275d4c15b9174c5763 (commit) discards b41143e17de2efb94bfbcc00374f9e7d555828e5 (commit) discards c55666b4391b55d2451cc05d5fde30b528a29c1d (commit) discards 5bee0f1be77fa166678cdce20fd514302a8b6d20 (commit) discards b442a2c3a00ce18b8c0ec549943b24175f61eb24 (commit) discards e16265ff92cc2a9822a1ada6829f2fbf45adb1dc (commit) discards a933249b1f9a8036b9e9e6f4ca704e862ce2faf9 (commit) discards 2f29cec422c253be15f2eef04067d1d4f5dfbfaf (commit) via f26e60871e12e8ba7651cf88cb402200f8226d16 (commit) via a01403135f477831cccb1c3fa34f7f29eaf75fd9 (commit) via 7ef4cda889445acfa00ca6307f5d5082d170d337 (commit) via a589e2334228c4fcb03fd952487424f0c2f46849 (commit) via 63e1de180de13d471acba8f9493bb2da783f94fc (commit) via 94b88420d562d1eca9174ec3e4e75a2785fa10dc (commit) via b1f69b82ad0c660e7a9e9b3c2802b538a1422f72 (commit) via 6ef5185fb4c9e56ea2ad8d1a946f3b100788a9c8 (commit) via 97a878aafcb9fb5d96d58d338eced4e33d0f44f3 (commit) via ec58b0fde961f2690bbbd96dba05fa95f8b6a372 (commit) via aefbc7f812bd6ba29b325259db6671e8445e9336 (commit) via b7a812dd4917127092506d553e272af5dae850a4 (commit) via ef9c480111a8690c75cdd6511548cb67937d8fec (commit) via a668032e7290ea919107eba7ef30e3cc692d7e4c (commit) via d6e43a22bc6881d76531ae50aca5890e54e1dd27 (commit) via c60d61364ef9495e1bc2abfac706c1df3910703e (commit) via 8afb1df85d77506299baa184e21a84659f821fd6 (commit) via 91b04b4ff6734b84ac86698fe9b997b6e4bfd2ec (commit) via b1d0a17cae829f4803e620c276a621dcb52e9e70 (commit) via 61b2347fe4723b9be3d610512204e751eafa121c (commit) via 22303b7ab5507251ef6018ce38c6f6d2821b49f1 (commit) via adce7f2e66dda08496454edc49ae2aa804b478a5 (commit) via c1ad672225924b65e17ccc0d3e1d2e4828712b04 (commit) via 294545274a140f585698e2eaee4ca9b958e5207c (commit) via 2c4db0257b18006ccf91c6f4d8c34e3f4acd289c (commit) via cfbd88c558cfc279dbd3f9cc01c66ba9a21bfbae (commit) via fbea9698cc7400f45814f240fcf673c86da1e894 (commit) via 06360a9cc6af1e97ab93d3e4df846661471795ee (commit) via 146c23de22a86621ae3df48df3931ff583ec13c7 (commit) via 295839dd2db778b3ed4ebe68698ee2c88fc58bf6 (commit) via 42597c626b6a50c12ae1c536af7699833bcf405c (commit) via caafb116e6b59a94b57380a0fa94cb8d661b9b60 (commit) via d3aa36bc23f87e037dd15cd2079ce455529ba08b (commit) via 18664281b5239bd2ad4a71da9996ac0d954177c3 (commit) via fba82b589b0763593e6bb75d56bd7de657e93b23 (commit) via c7f93129734fb626289298553df2db1d7750fbe9 (commit) via 5720e111bb16a99efda26e83fc2cc97bb890bfc6 (commit) via 74488941a0ead3b187855c69f2643198380574ac (commit) via ed48d1632192d31b18c521df2d3361ea7bdedc0e (commit) via 2f9549fe28ebfc1a2afb86e299e607e8ef39139b (commit) via 601e6f52fee68b32ed30e5fc9a21d87a5fa2b041 (commit) via 52c39ec0b2a607f93da2eb8ef91627154a079519 (commit) via e0e3ef9045db29818d54f5cd9477e07bd17721ed (commit) via 2043ac58d38452c033d26579f0f17a301943f7f8 (commit) via ee6093e8c41b580edb74f55987184fc8cc1a1cab (commit) via da4b06c8aab71118e3cac9272b853f60c61e1e1a (commit) via 4f4a50060707b7f669d7962f6f5976d629d9da90 (commit) via 12e31f35b30518836aca25487f8d812804d059e7 (commit) via e7a11fc8cf574dc6a945d1d662c9f38ae4bc79b7 (commit) via 365cccf226609730d3e1c82b244b8736682c3cfc (commit) via 3f5220a976bd61ecfc9eb432b37f32cb7818a13f (commit) via c26ab3582fedb5cf90072c977586c1cab5cc25c5 (commit) via e76d8f495098c50581b07afaea62b54e0344f301 (commit) via ae0abbcfaffe5460d26641ccd19dd7ee022a81f4 (commit) via b8aa5d2d87720b19aff29ab5210bb7a4fb0f89c3 (commit) via 369e9c4f566a6c7c44481fc8434d5008efb61b32 (commit) via d6b71a966ab398e67b2011bdf0f24dc9ca51f9b4 (commit) via 07cbf74b89eed441820ac018d0cb2ecd21746f86 (commit) via d8e2260eaed12c7d11e885e82d252b7ea66d6e04 (commit) via 80cc28dff3a8cd1ab736016e5c3c3c57125ca09b (commit) via c3c37e6644ca04bd1022dc58e315024789f35083 (commit) via affc6055a06debad749a30a843ea804ebf574601 (commit) via 3eb2a51c46804f0be530893e94af559abee8b4f8 (commit) via dc494069c836882834b58d9ddcce138664506407 (commit) via df1d3df3301756235f18919ccea03f9353225eea (commit) via 546eb05e3a883af5fcf1513c386eb0db749cb43c (commit) via c86349e2b62a613c60a568a906ebec927aa159ec (commit) via bde79dd528687683b9a3041b91b2c9fce3fb8eed (commit) via 8183711475fe01dbe481c63eaf2f7e9194331f05 (commit) via ac26ece4e3fb025f54f1cf56a226a3ad77416586 (commit) via 0354583c5e842015f3b54116c89110d43e63b2f0 (commit) via aa5b4b2cb2665ee0fc06885f311f1f2c519ed337 (commit) via 091e0eecf207d7557cecb3c015d477fe90f9f560 (commit) via 5c0483514a78fd1d07d255241c19b8556dd6a1c6 (commit) via e3f520c455ed113e0eee8e4e85e6f56f3fdb71a7 (commit) via d3a851bf984a159b45f4d92f51ef90d49c84627e (commit) via b0b72d14aefe9252bf4638087fe60174a3a9e10f (commit) via 0d49fd8a9a093ecb6f33960a6d2f8793d7958e94 (commit) via 86b94567968e87f6ace1dbd63dc913f0284fd133 (commit) via 0fd73668f658231452795b53ce348b2ef1eb72e8 (commit) via 67bd2c9af4e5366af4ecab5e18ab3d2defce4af1 (commit) via c9e6e004ed57006e3756f42d987922b48e7c6eac (commit) via 76dc4bb9cbed27e6c4d802a81c669828c4b80dc2 (commit) via 6876850721768f002bdebf47ea013b6283403d37 (commit) via ee9c380976c428455ba465c586e1c945fb1c0e97 (commit) via 7ac839d2ea970056e05eb9aabfa2925c6c9d6a13 (commit) via 34d2892f76ba085447dad2041ebace48815a45fc (commit) via 79aeb20ca9af9669fca91eb85950f816bbe8a4e9 (commit) via 06d59c620a5c8a598b9711ee7869ca83175b93f1 (commit) via a72f82fc28e2e0464fc59fc418c2a2b7d6db315c (commit) via 8169424bbf064788c952aadb142993fa4eee61f6 (commit) via 99a8549b696b9943585e216bb352aa274b9344a9 (commit) via a019568598ef099621feee572b3229079d68e6a2 (commit) via 6fcd25589f95ed1c663b4993b5faa47fad2389d4 (commit) via 72de6e69758282b35491e7289d368eb7542f638f (commit) via fc07e754275bc3e4bbe2bd762fdd8fdb57ddc102 (commit) via d6fab887386fae52a12bd6864382564bbeda8514 (commit) via 00ed95a3aacde879bc7fcb7888c69091f33b41b8 (commit) via 412237328f6a7293cfba3f85d914f896db975af1 (commit) via 783bc92bdf91418a80557af431c7e4f86ecee768 (commit) via d72eabc6f823fe4e3a4eafa81a119867c988a0c4 (commit) via 5f9197eeaf0fa87eb98ac6ebaf88930f33821eab (commit) via 61ce8822bafd4554dd911d8f58d7142f3839bb2b (commit) via fa466a282b30a743765b2a8cd1ecc74bb5d796db (commit) via 6f6adb3c6b95796c51a48920526c6ef98afae9f8 (commit) via e3be5bf957b120a042ceb164213af36d7bca32b5 (commit) via c8d7739e9cf54d4aa465bde90a6ec94ffdfb33c4 (commit) via 488588c3628913be0dbcf7113cee04c1cd791d5d (commit) via 4f20a2011c6cec47718bff32a9a8de67eac63b53 (commit) via 3b29b975fe1a101ef9feb0a130570228152019c9 (commit) via 13f2e76510cd8d5b2da22d958cdcc3dd3e785005 (commit) via a5d4bb2f9bfe5ed5911e9e79d0f00a8de790727d (commit) via aac6de18bb842276b6d26bea129de9901ae891df (commit) via b7bab74342776d73cef3a9c060810fbb80328312 (commit) via 7645df08c5ba29820e44a03f7bbf70b478801cae (commit) via c6bf3878c5f48650e928c55e7a454583d977a1cf (commit) via e3ae979a6c36d47350919caaf654e656dea3ac76 (commit) via 01219ac3f8e7fa6f5a5876afd826d0283d29524b (commit) via 2f2a2015c740d447fee472e08471aa28d416b551 (commit) via c91374499747d84609217f6815ffa6e637dedba3 (commit) via 1d990d7bb9acc77de45d92801bc116f875bfd621 (commit) via 1dbe9d429b900945876f8c8c0358f4a18ce57c66 (commit) via 49fca17027ea8a35eae2353248b527415f95f25e (commit) via 2005985ad1c8abbf905a9c6ab269e9a96f836e3b (commit) via 35c1e5efc16caf256acb5c76df8f02a3f1de246e (commit) via 2d3bbd57c568f6586015ee82b9d2db1d1432cb14 (commit) via 39cc9036cec20e713f4ec002e425422c21f81b12 (commit) via 29b26fc5635d26ca73927809396f6c8c03de159e (commit) via 7513d357f031eb43c1dc4b309faa80922c41004d (commit) via 62234c99e3a311c07838ebaea38198d7f4239d0c (commit) via a1dc2890b9843e7bbadb81cf7d733d2954dbb097 (commit) via c84620664b6cd95ef9d2609c73c6832dba830cdf (commit) via 636305372b3cdc5b60127ed7ea546bdbee217226 (commit) via 2e687216be4e6f289cb8083e18f1ccfb3bde90cd (commit) via e0ede36274a194c07ed4407f4471849e3bda9db8 (commit) via 27ace36109505b3b255e60778b487decce10e92e (commit) via 7fb29343dacbc73483669327128c491a9a17ccaa (commit) via 80a8b525413b213614508a73c3b95e683e412942 (commit) via a906bc6480dbdc7cc1bd54884702fb807ef0fbc1 (commit) via 9b859adb4f3dfc4df5022746517422d8769100ee (commit) via 65882c1a92a8d600890bab983a7e013faac37e3e (commit) via 6466b77e27b5743f65a4c3e02fa6ef17c86f43bd (commit) via e99af83087857cf32e550d45c338587dd0fc1a6c (commit) via 174e82f2f135bada36bbb0abf52b46319421b71a (commit) via 3d850673810aa884193630d83749cb658165c8b2 (commit) via cf5b0fcbc621db7b4b9da236866a26431151def6 (commit) via 5ce3c185948cce3e2d7e1801bb19aac009ca7ebb (commit) via 6a7ee8d8ad61cfb463d7e9bb95dd7dd23f5d8110 (commit) via 210e3c157c1380359c9702b99eac0a83416ccc24 (commit) via 81387c7f1f50f0b076617fd37e2df0055a74e762 (commit) via b30830ad38d34bdeedd0e5571845821eae50b661 (commit) via 73748a82bb4a64335cc3388b34ef9c5486b69e65 (commit) via d0a19b37c43775341c5412d90635353345b5f5c8 (commit) via 8bc515ce4080608a1a35b00d8d9706a5778025d6 (commit) via 826738a7377eb04bf47c7a9f469948de0b4ec4ab (commit) via cd1f6ea471233b241a973de805d3bb6386d6edf1 (commit) via f3cc1179691abf92468d89452aae2e1fe5ced731 (commit) via 9cba98336ff14e06e83494a55c71e795f130700d (commit) via 5aee30367e9dfb9af9b3b461d91eb640ed2c94ea (commit) via 452e29236ed5bf99404ecd3531df85a058a12ff5 (commit) via 4072a8adda6f9c894beee03ed64a2b3c9b8c182b (commit) via 12eebc99a69a969e7d2adaffdc48e6714ecccb6e (commit) via 0dc1cb92d94b5f56c9bf29b2b103839453b22f36 (commit) via 0baf8277ae52466a945c9e97bdc64459b38cca94 (commit) via f1710886bbcad31da44b5ab3be5e9fbc04c0fb49 (commit) via d0b63f741de6049646fe979182fb390f219ce934 (commit) via 4b7405c0381c72b154d8dddd82cf4e960e27720c (commit) via 7d9b86e671db86e2d42b833f6033bad30312fea2 (commit) via 73b53903b87f8b8d4561327358bb2ecb55d202fb (commit) via 4fd63bf1390f2e850157a51c5771a304dc713d31 (commit) via cc10b3df010272968aa2e6e1768ffd5da2100f4b (commit) via d192e191467b71a5ab3bc93515126ed534148602 (commit) via 5a4337e6ec84ebc21bdf15e9d7076576e4f8e862 (commit) via 6f78e1e9b3d53d75b3f8c9fe2fb0c90774fc3641 (commit) via f26df3c4024643a8608ba16fd9cfd1e04048b9d7 (commit) via dde6c19a39f11b3835b9903fc459f337b86daf81 (commit) via 10361b212f7b40ed6eacf773adf7716f8f640e1e (commit) via dbd14a18547bd78def0d91c5bb5324d79b87cad4 (commit) via 1035e7311fb8ea56f99c4698e9e8ee1dfb0c4f86 (commit) via 92dc8d9605a1472907a18e5548b0116ed759c42b (commit) via 753a490543a83113f173beba637b2adf661b8698 (commit) via 8e8d0e321d16b1c1bdb71ad268df467a13ad3b81 (commit) from 5dff075c4c32032ec8e7f9be971fae85704a57b8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit f26e60871e12e8ba7651cf88cb402200f8226d16 Author: Tom Tromey 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. * 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. * linux-tdep.c (linux_make_corefile_notes): 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 a01403135f477831cccb1c3fa34f7f29eaf75fd9 Author: Tom Tromey Date: Fri May 24 09:42:28 2013 -0600 maintenance_expand_symtabs leaks a cleanup 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. commit 7ef4cda889445acfa00ca6307f5d5082d170d337 Author: Tom Tromey Date: Fri May 17 09:40:41 2013 -0600 fix solib-som.c som_open_symbol_file_object was leaking a cleanup. * solib-som.c (som_open_symbol_file_object): Call do_cleanups. commit a589e2334228c4fcb03fd952487424f0c2f46849 Author: Tom Tromey Date: Thu May 16 14:43:34 2013 -0600 fix init_cutu_and_read_dies commit 63e1de180de13d471acba8f9493bb2da783f94fc Author: Tom Tromey Date: Thu May 16 14:42:15 2013 -0600 fix dwarf_decode_line_header commit 94b88420d562d1eca9174ec3e4e75a2785fa10dc Author: Tom Tromey 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 b1f69b82ad0c660e7a9e9b3c2802b538a1422f72 Author: Tom Tromey 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 6ef5185fb4c9e56ea2ad8d1a946f3b100788a9c8 Author: Tom Tromey 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 97a878aafcb9fb5d96d58d338eced4e33d0f44f3 Author: Tom Tromey 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 (adjust_pc_after_break): Introduce an outer null cleanup. commit ec58b0fde961f2690bbbd96dba05fa95f8b6a372 Author: Tom Tromey 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 (varobj_update_one): Add an outer null cleanup. commit aefbc7f812bd6ba29b325259db6671e8445e9336 Author: Tom Tromey 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 b7a812dd4917127092506d553e272af5dae850a4 Author: Tom Tromey 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 ef9c480111a8690c75cdd6511548cb67937d8fec Author: Tom Tromey 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 a668032e7290ea919107eba7ef30e3cc692d7e4c Author: Tom Tromey 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 d6e43a22bc6881d76531ae50aca5890e54e1dd27 Author: Tom Tromey 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 c60d61364ef9495e1bc2abfac706c1df3910703e Author: Tom Tromey 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 8afb1df85d77506299baa184e21a84659f821fd6 Author: Tom Tromey 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 91b04b4ff6734b84ac86698fe9b997b6e4bfd2ec Author: Tom Tromey 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 b1d0a17cae829f4803e620c276a621dcb52e9e70 Author: Tom Tromey 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 61b2347fe4723b9be3d610512204e751eafa121c Author: Tom Tromey 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 22303b7ab5507251ef6018ce38c6f6d2821b49f1 Author: Tom Tromey 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 adce7f2e66dda08496454edc49ae2aa804b478a5 Author: Tom Tromey 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 c1ad672225924b65e17ccc0d3e1d2e4828712b04 Author: Tom Tromey 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 294545274a140f585698e2eaee4ca9b958e5207c Author: Tom Tromey 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 2c4db0257b18006ccf91c6f4d8c34e3f4acd289c Author: Tom Tromey 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 cfbd88c558cfc279dbd3f9cc01c66ba9a21bfbae Author: Tom Tromey 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 fbea9698cc7400f45814f240fcf673c86da1e894 Author: Tom Tromey 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 06360a9cc6af1e97ab93d3e4df846661471795ee Author: Tom Tromey 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 146c23de22a86621ae3df48df3931ff583ec13c7 Author: Tom Tromey 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 295839dd2db778b3ed4ebe68698ee2c88fc58bf6 Author: Tom Tromey 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 42597c626b6a50c12ae1c536af7699833bcf405c Author: Tom Tromey 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. commit caafb116e6b59a94b57380a0fa94cb8d661b9b60 Author: Tom Tromey 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 d3aa36bc23f87e037dd15cd2079ce455529ba08b Author: Tom Tromey 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 18664281b5239bd2ad4a71da9996ac0d954177c3 Author: Tom Tromey 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 fba82b589b0763593e6bb75d56bd7de657e93b23 Author: Tom Tromey 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 c7f93129734fb626289298553df2db1d7750fbe9 Author: Tom Tromey 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 5720e111bb16a99efda26e83fc2cc97bb890bfc6 Author: Tom Tromey 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 74488941a0ead3b187855c69f2643198380574ac Author: Tom Tromey 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 ed48d1632192d31b18c521df2d3361ea7bdedc0e Author: Tom Tromey 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 2f9549fe28ebfc1a2afb86e299e607e8ef39139b Author: Tom Tromey 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 601e6f52fee68b32ed30e5fc9a21d87a5fa2b041 Author: Tom Tromey 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 52c39ec0b2a607f93da2eb8ef91627154a079519 Author: Tom Tromey 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 e0e3ef9045db29818d54f5cd9477e07bd17721ed Author: Tom Tromey 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 2043ac58d38452c033d26579f0f17a301943f7f8 Author: Tom Tromey Date: Mon Mar 4 11:20:36 2013 -0700 add README.archer commit ee6093e8c41b580edb74f55987184fc8cc1a1cab Author: abidh Date: Thu May 30 12:54:17 2013 +0000 2013-05-30 Hafiz Abid Qadeer * inferior.c (top level): Include tilde.h. (add_inferior_command): Call tilde_expand on the value of 'exec' argument. commit da4b06c8aab71118e3cac9272b853f60c61e1e1a Author: qiyao Date: Thu May 30 09:29:18 2013 +0000 gdb/ * 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. commit 4f4a50060707b7f669d7962f6f5976d629d9da90 Author: Pedro Alves Date: Thu May 30 08:56:55 2013 +0000 Fix build breakage with Python 2.4. 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 * python/python-internal.h (gdb_Py_DECREF): Cast OP to PyObject pointer. commit 12e31f35b30518836aca25487f8d812804d059e7 Author: qiyao Date: Thu May 30 00:40:20 2013 +0000 gdb/ * remote.c (remote_check_symbols): Remove unused parameter 'objfile'. Declaration update. (remote_start_remote, remote_new_objfile): Caller update. commit e7a11fc8cf574dc6a945d1d662c9f38ae4bc79b7 Author: qiyao Date: Thu May 30 00:25:16 2013 +0000 gdb/ * 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. commit 365cccf226609730d3e1c82b244b8736682c3cfc Author: gdbadmin Date: Thu May 30 00:00:32 2013 +0000 *** empty log message *** commit 3f5220a976bd61ecfc9eb432b37f32cb7818a13f Author: Alan Modra Date: Thu May 30 00:00:06 2013 +0000 daily update commit c26ab3582fedb5cf90072c977586c1cab5cc25c5 Author: Nick Clifton Date: Wed May 29 14:58:35 2013 +0000 * dwarf2.c (struct dwarf2_debug): Add fields for handling 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. commit e76d8f495098c50581b07afaea62b54e0344f301 Author: Pedro Alves Date: Wed May 29 11:57:48 2013 +0000 [remote] Insert breakpoints in the right process. I noticed that gdb.multi/multi-arch.exp wasn't passing with extended-remote GDBserver with my pending multi-process+multi-arch series anymore on current mainline, while it used to pass before: (gdb) run Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/ma-hangout Process /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/ma-hangout created; pid = 32067 Warning: Cannot insert breakpoint 2. Error accessing memory address 0x4005c2: Unknown error -1. Cannot insert breakpoint -1. Temporarily disabling shared library breakpoints: breakpoint #-1 (gdb) FAIL: gdb.multi/multi-arch.exp: starting inferior 2 Investigating manually, I found an easy way to reproduce. You just need breakpoints on distinct inferiors, and a way to have GDB install them in one go: (gdb) set breakpoint always-inserted on (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint del n 2.1 y 0x00000000004005c2 in main at ../../../src/gdb/testsuite/gdb.multi/hello.c:40 inf 1 2.2 y 0x08048475 in main at ../../../src/gdb/testsuite/gdb.multi/hangout.c:22 inf 2 (gdb) enable 2 Warning: Cannot insert breakpoint 2. Error accessing memory address 0x4005c2: Unknown error -1. And turning on remote debugging, we see: (gdb) set debug remote 1 (gdb) disable 2 (gdb) enable 2 Sending packet: $Z0,4005c2,1#71...Packet received: E01 Sending packet: $Z0,8048475,1#87...Packet received: OK Warning: Cannot insert breakpoint 2. Error accessing memory address 0x4005c2: Unknown error -1. Notice that each of those Z0 breakpoints should be set in different processes. However, no Hg packet to select a process has been sent in between, so GDBserver tries to plant both on the same process that happens to be current. The first Z0 then not so surprisingly fails. IOW, the blame is on GDB, for telling GDBserver to plant both breakpoints in the same process. remote.c has a lazy scheme where it keeps a local cache of the remote's selected general thread, and delays updating it on the remote side until necessary (memory/register reads/writes, etc.). This is done to reduce RSP traffic. The bug is that the Zx breakpoint insert/remove methods weren't committing the selected thread/process back to the remote side: Breakpoint 3, remote_insert_breakpoint (gdbarch=0x1383ae0, bp_tgt=0x140c2b0) at ../../src/gdb/remote.c:8148 8148 if (remote_protocol_packets[PACKET_Z0].support != PACKET_DISABLE) (top-gdb) p inferior_ptid $3 = {pid = 3670, lwp = 0, tid = 3670} (top-gdb) p general_thread $4 = {pid = 3671, lwp = 0, tid = 3671} IOW, a call to set_general_process is missing. I did some auditing over remote.c, and added calls to all places I found missing it. This only used to work by chance before. breakpoint.c switches to a thread of the target process before installing a breakpoint location. That calls switch_to_thread. Before: 2012-07-27 Yao Qi * thread.c (switch_to_thread): Don't call registers_changed. that caused the register caches to all be flushed and refetched before installing the breakpoint location. Given fetching registers commits the remote general thread (with Hg), masking out the latent bug. Tested on x86_64 Fedora 17 with GDBserver. gdb/ 2013-05-29 Pedro Alves * remote.c (remote_insert_breakpoint, remote_remove_breakpoint) (remote_insert_watchpoint, remote_remove_watchpoint) (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint) (remote_verify_memory, compare_sections_command) (remote_search_memory): Set the general process/thread on the remote side. commit ae0abbcfaffe5460d26641ccd19dd7ee022a81f4 Author: Pedro Alves Date: Wed May 29 09:18:47 2013 +0000 [AArch64] Remove all traces of aarch64-without-fpu.xml. The aarch64-without-fpu description is unused. Linux requires an FPU, so the AArch64 native port always returns the with-fpu variant: static const struct target_desc * aarch64_linux_read_description (struct target_ops *ops) { initialize_tdesc_aarch64 (); return tdesc_aarch64; } When the target doesn't report a target description at all, we fallback to a register set with an FPU: aarch64_gdbarch_init () ... if (!tdesc_has_registers (tdesc)) tdesc = tdesc_aarch64; This just removes the dead description. Tested by building on x86_64 Fedora 17 with --enable=targets=all. gdb/ 2013-05-29 Pedro Alves * aarch64-tdep.c: Don't include "features/aarch64-without-fpu.c". (_initialize_aarch64_tdep): Don't call initialize_tdesc_aarch64_without_fpu. * features/Makefile (WHICH): Remove reference to aarch64-without-fpu. * features/aarch64-without-fpu.c: Delete file. * regformats/aarch64-without-fpu.dat: Delete file. commit b8aa5d2d87720b19aff29ab5210bb7a4fb0f89c3 Author: Alan Modra Date: Wed May 29 00:00:04 2013 +0000 daily update commit 369e9c4f566a6c7c44481fc8434d5008efb61b32 Author: gdbadmin Date: Wed May 29 00:00:02 2013 +0000 *** empty log message *** commit d6b71a966ab398e67b2011bdf0f24dc9ca51f9b4 Author: yufeng Date: Tue May 28 16:39:49 2013 +0000 Correct the relocation names for R_AARCH64_TLSDESC_LD_PREL19 and R_AARCH64_TLSDESC_ADR_PAGE21. commit 07cbf74b89eed441820ac018d0cb2ecd21746f86 Author: Pedro Alves Date: Tue May 28 10:41:16 2013 +0000 [GDBserver][AArch64] Remove references to aarch64-without-fpu.xml. The GDBserver Aarch64 port includes the aarch64-without-fpu description in the build, but doesn't actually use it anywhere. As Linux always requires an FPU, just remove the dead code. gdb/gdbserver/ 2013-05-28 Pedro Alves * Makefile.in (clean): Remove reference to aarch64-without-fpu.c. (aarch64-without-fpu.c): Delete rule. * configure.srv (aarch64*-*-linux*): Remove references to aarch64-without-fpu.o and aarch64-without-fpu.xml. * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove declaration. commit d8e2260eaed12c7d11e885e82d252b7ea66d6e04 Author: qiyao Date: Tue May 28 02:55:04 2013 +0000 gdb/ * tracepoint.c (stringify_collection_list): Remove parameter 'string'. (encode_actions): Caller update. Remove local variables. commit 80cc28dff3a8cd1ab736016e5c3c3c57125ca09b Author: Alan Modra Date: Tue May 28 00:00:04 2013 +0000 daily update commit c3c37e6644ca04bd1022dc58e315024789f35083 Author: gdbadmin Date: Tue May 28 00:00:02 2013 +0000 *** empty log message *** commit affc6055a06debad749a30a843ea804ebf574601 Author: mark Date: Mon May 27 07:55:16 2013 +0000 bfd: Make bfd_cache_max_open depend on actual open file limit. The current hard coded limit of open files in bfd/cache.c is 10. This is pretty low these days. Binaries are often linked against much more than 10 files (and sometimes against more than 100 shared libraries). When debugging with GDB some files are opened and closed multiple times because of this low limit. If possible make the BFD cache file limit depend on the actual open file limit of the process so more BFD files can be open at the same time. * cache.c (BFD_CACHE_MAX_OPEN): Remove define. (max_open_files): New static int initialized to zero. (bfd_cache_max_open): New static function to set and return max_open_files. (bfd_cache_init): Use bfd_cache_max_open. (bfd_open_file): Likewise. * configure.in (AC_CHECK_HEADERS): Add sys/resource.h. (AC_CHECK_FUNCS): Add getrlimit. * configure: Regenerated. * config.in: Likewise. * sysdep.h: Check and include sys/resource.h for getrlimit. commit 3eb2a51c46804f0be530893e94af559abee8b4f8 Author: Alan Modra Date: Mon May 27 00:00:04 2013 +0000 daily update commit dc494069c836882834b58d9ddcce138664506407 Author: gdbadmin Date: Mon May 27 00:00:03 2013 +0000 *** empty log message *** commit df1d3df3301756235f18919ccea03f9353225eea Author: Alan Modra Date: Sun May 26 00:00:04 2013 +0000 daily update commit 546eb05e3a883af5fcf1513c386eb0db749cb43c Author: gdbadmin Date: Sun May 26 00:00:02 2013 +0000 *** empty log message *** commit c86349e2b62a613c60a568a906ebec927aa159ec Author: Alan Modra Date: Sat May 25 00:00:04 2013 +0000 daily update commit bde79dd528687683b9a3041b91b2c9fce3fb8eed Author: gdbadmin Date: Sat May 25 00:00:03 2013 +0000 *** empty log message *** commit 8183711475fe01dbe481c63eaf2f7e9194331f05 Author: Richard Sandiford Date: Fri May 24 17:13:49 2013 +0000 opcodes/ * s390-opc.txt (flogr): Require a register pair destination. gas/testsuite/ * gas/s390/zarch-z9-109-err.s, gas/s390/zarch-z9-109-err.l: New test. * gas/s390/s390.exp: Run it. commit ac26ece4e3fb025f54f1cf56a226a3ad77416586 Author: Jan Kratochvil Date: Fri May 24 15:37:24 2013 +0000 gdb/testsuite/ PR testsuite/12649 * gdb.mi/mi-dprintf.exp (mi_continue_dprintf) (mi 2nd dprintf): Replace $mi_gdb_prompt expectation by mi_expect_stop. (mi 1st dprintf, agent, mi 2nd dprintf, agent) (mi info dprintf second time): Replace them by mi_send_resuming_command and mi_expect_stop. commit 0354583c5e842015f3b54116c89110d43e63b2f0 Author: gary Date: Fri May 24 14:02:35 2013 +0000 2013-05-24 Gary Benson * gdb.base/solib-disc.exp (exec_opts): Remove unnecesary backslash. * gdb.base/unload.exp (exec_opts): Remove two unnecessary backslashes. * gdb.base/watchpoint-solib.exp (exec_opts): Remove unnecesary backslash. commit aa5b4b2cb2665ee0fc06885f311f1f2c519ed337 Author: qiyao Date: Fri May 24 12:27:38 2013 +0000 gdb/ * tracepoint.c (TFILE_PID): Remove. (tfile_open): Don't add thread and inferior. (tfile_close): Don't set 'inferior_ptid'. Don't call exit_inferior_silent. (tfile_thread_alive): Remove. (init_tfile_ops): Don't set field 'to_thread_alive' of tfile_ops. gdb/testsuite/ * gdb.trace/tfile.exp: Test inferior and thread. commit 091e0eecf207d7557cecb3c015d477fe90f9f560 Author: Pedro Alves Date: Fri May 24 11:28:06 2013 +0000 [gdbserver] Don't assume vCont;r ADDR1,ADDR2 comes with a ptid attached. This bit: + p1 = strchr (p, ':'); + decode_address (&resume_info[i].step_range_end, p, p1 - p); should not expect the ':' to be there. An action without a ptid is valid: "If an action is specified with no thread-id, then it is applied to any threads that don't have a specific action specified" This is handled further below: if (p[0] == 0) { resume_info[i].thread = minus_one_ptid; default_action = resume_info[i]; /* Note: we don't increment i here, we'll overwrite this entry the next time through. */ } else if (p[0] == ':') A stub that doesn't support and report to gdb thread ids at all (like metal metal targets) only will always only see a single default action with no ptid. Use unpack_varlen_hex instead of decode_address. The former doesn't need to be told where the hex number ends, and it actually returns that info instead, which we can use for validation. Tested on x86_64 Fedora 17. gdb/gdbserver/ 2013-05-24 Pedro Alves * server.c (handle_v_cont) : Use unpack_varlen_hex instead of strchr/decode_address. Error if the range isn't split with a ','. Don't assume there's be a ':' in the action. commit 5c0483514a78fd1d07d255241c19b8556dd6a1c6 Author: qiyao Date: Fri May 24 09:57:12 2013 +0000 gdb/testsuite/ * gdb.base/range-stepping.exp: Skip the rest of tests if the test fails. * lib/range-stepping-support.exp (exec_cmd_expect_vCont_count): Return 0 if the test passes, otherwise return 1. commit e3f520c455ed113e0eee8e4e85e6f56f3fdb71a7 Author: Joel Brobecker Date: Fri May 24 04:50:26 2013 +0000 Fix gdb.info build failure gdb.texinfo:36367: `Installed System-wide Configuration Scripts' has no Up field (perhaps incorrect sectioning?). gdb.texinfo:36367: warning: unreferenced node `Installed System-wide Configuration Scripts'. gdb/doc/ChangeLog: * gdb.texinfo (System-wide Configuration Scripts): Renames "Installed System-wide Configuration Scripts". Add associated @menu block. commit d3a851bf984a159b45f4d92f51ef90d49c84627e Author: Doug Evans Date: Fri May 24 01:33:50 2013 +0000 Update to load fission.exp. commit b0b72d14aefe9252bf4638087fe60174a3a9e10f Author: Doug Evans Date: Fri May 24 01:30:05 2013 +0000 * boards/fission-dwp.exp: New file. commit 0d49fd8a9a093ecb6f33960a6d2f8793d7958e94 Author: Doug Evans Date: Fri May 24 00:30:24 2013 +0000 * contrib/cc-with-tweaks.sh (-p): Handle no dwo files. commit 86b94567968e87f6ace1dbd63dc913f0284fd133 Author: Alan Modra Date: Fri May 24 00:00:05 2013 +0000 daily update commit 0fd73668f658231452795b53ce348b2ef1eb72e8 Author: gdbadmin Date: Fri May 24 00:00:02 2013 +0000 *** empty log message *** commit 67bd2c9af4e5366af4ecab5e18ab3d2defce4af1 Author: Pedro Alves Date: Thu May 23 18:36:59 2013 +0000 common/filestuff.c: No sockets on DJGPP. Building gdb with --host=i586-pc-msdosdjgpp ends up with: i586-pc-msdosdjgpp-gcc -g -O2 -I../../src/gdb/config/djgpp -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber -I./../intl -I../../src/gdb/gnulib/import -Ibuild-gnulib/import -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Werror -c -o filestuff.o -MT filestuff.o -MMD -MP -MF .deps/filestuff.Tpo ../../src/gdb/common/filestuff.c ../../src/gdb/common/filestuff.c:38:24: fatal error: sys/socket.h: No such file or directory There are no sockets on djgpp. This #ifdef's out the bits in the file that use sockets, depending on whether winsock or sys/socket.h is available. As alternative approach, given ser-tcp.c, ser-pipe.c, etc. are split into separate files, and which to use is selected by configure.ac: dnl Figure out which of the many generic ser-*.c files the _host_ supports. SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o" case ${host} in *go32* ) SER_HARDWIRE=ser-go32.o ;; *djgpp* ) SER_HARDWIRE=ser-go32.o ;; *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;; esac AC_SUBST(SER_HARDWIRE) ... I considered splitting filestuff.c similarly. But I quickly gave up on the idea, as it looked like a lot more complication over this approach, for no real gain. Plus, there are uses of these functions outside the ser*.c framework. gdbserver's configure.ac is already checking for sys/socket.h. gdb/ 2013-05-23 Pedro Alves * common/filestuff.c [USE_WIN32API]: Define HAVE_SOCKETS. [HAVE_SYS_SOCKET_H]: Define HAVE_SOCKETS. (socket_mark_cloexec, gdb_socketpair_cloexec, gdb_socket_cloexec): Only define if HAVE_SOCKETS is defined. * configure.ac: Check for sys/socket.h. * config.in, configure: Regenerate. commit c9e6e004ed57006e3756f42d987922b48e7c6eac Author: Pedro Alves Date: Thu May 23 18:31:29 2013 +0000 dwarf2read.c: Don't assume uint32_t is unsigned int on all hosts. Building gdb on GNU/Linux, for --host=i586-pc-msdosdjgpp, I get: ../../src/gdb/dwarf2read.c: In function 'create_dwp_hash_table': ../../src/gdb/dwarf2read.c:8626:7: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' [-Werror=format] ../../src/gdb/dwarf2read.c:8632:7: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' [-Werror=format] ../../src/gdb/dwarf2read.c: In function 'create_dwo_in_dwp': ../../src/gdb/dwarf2read.c:8754:6: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' [-Werror=format] ../../src/gdb/dwarf2read.c: In function 'open_and_init_dwp_file': ../../src/gdb/dwarf2read.c:9248:6: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format] ../../src/gdb/dwarf2read.c:9248:6: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format] And: $ grep uint32_t /usr/i586-pc-msdosdjgpp/sys-include/* /usr/i586-pc-msdosdjgpp/sys-include/stdint.h:typedef unsigned long uint32_t; As decided on the discussion at , use pulongest rather than PRIu32. Tested on F17. Also confirmed GDB still builds OK with --host=i686-w64-mingw32. gdb/ 2013-05-23 Pedro Alves * dwarf2read.c (create_dwp_hash_table, create_dwo_in_dwp) (open_and_init_dwp_file): Use %s/pulongest instead of %u for printing uint32_t variables. commit 76dc4bb9cbed27e6c4d802a81c669828c4b80dc2 Author: Pedro Alves Date: Thu May 23 17:19:04 2013 +0000 range stepping: tests This adds tests to verify range stepping is used as expected, by inspecting the RSP traffic, looking for vCont;s and vCont;r packets. gdb/testsuite/ 2013-05-23 Yao Qi Pedro Alves * gdb.base/range-stepping.c: New file. * gdb.base/range-stepping.exp: New file. * gdb.trace/range-stepping.c: New file. * gdb.trace/range-stepping.exp: New file. * lib/range-stepping-support.exp: New file. commit 6876850721768f002bdebf47ea013b6283403d37 Author: Pedro Alves Date: Thu May 23 17:17:50 2013 +0000 range stepping: gdbserver (x86 GNU/Linux) This patch adds support for range stepping to GDBserver, teaching it about vCont;r. It'd be easy to enable this for all hardware single-step targets without needing the linux_target_ops hook, however, at least PPC needs special care, due to the fact that PPC atomic sequences can't be hardware single-stepped through, a thing which GDBserver doesn't know about. So this leaves the support limited to x86/x86_64. gdb/ 2013-05-23 Pedro Alves * NEWS: Mention GDBserver range stepping support. gdb/gdbserver/ 2013-05-23 Yao Qi Pedro Alves * linux-low.c (lwp_in_step_range): New function. (linux_wait_1): If the thread was range stepping and stopped outside the stepping range, report the stop to GDB. Otherwise, continue stepping. Add range stepping debug output. (linux_set_resume_request): Copy the step range from the resume request to the lwp. (linux_supports_range_stepping): New. (linux_target_ops) : Set to linux_supports_range_stepping. * linux-low.h (struct linux_target_ops) : New field. (struct lwp_info) : New fields. * linux-x86-low.c (x86_supports_range_stepping): New. (the_low_target) : Set to x86_supports_range_stepping. * server.c (handle_v_cont): Handle 'r' action. (handle_v_requests): Append ";r" if the target supports range stepping. * target.h (struct thread_resume) : New fields. (struct target_ops) : New field. (target_supports_range_stepping): New macro. commit ee9c380976c428455ba465c586e1c945fb1c0e97 Author: Pedro Alves Date: Thu May 23 17:15:34 2013 +0000 range stepping: gdb This patch teaches GDB to take advantage of target-assisted range stepping. It adds a new 'r ADDR1,ADDR2' action to vCont (vCont;r), meaning, "step once, and keep stepping as long as the thread is in the [ADDR1,ADDR2) range". Rationale: When user issues the "step" command on the following line of source, a = b + c + d * e - a; GDB single-steps every single instruction until the program reaches a new different line. E.g., on x86_64, that line compiles to: 0x08048434 <+65>: mov 0x1c(%esp),%eax 0x08048438 <+69>: mov 0x30(%esp),%edx 0x0804843c <+73>: add %eax,%edx 0x0804843e <+75>: mov 0x18(%esp),%eax 0x08048442 <+79>: imul 0x2c(%esp),%eax 0x08048447 <+84>: add %edx,%eax 0x08048449 <+86>: sub 0x34(%esp),%eax 0x0804844d <+90>: mov %eax,0x34(%esp) 0x08048451 <+94>: mov 0x1c(%esp),%eax and the following is the RSP traffic between GDB and GDBserver: --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:3c840408;thread:p2e13.2e13;core:1; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:3e840408;thread:p2e13.2e13;core:2; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:42840408;thread:p2e13.2e13;core:2; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:47840408;thread:p2e13.2e13;core:0; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:49840408;thread:p2e13.2e13;core:0; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:4d840408;thread:p2e13.2e13;core:0; --> vCont;s:p2e13.2e13;c <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2e13.2e13;core:0; IOW, a lot of roundtrips between GDB and GDBserver. If we add a new command to the RSP, meaning "keep stepping and don't report a stop until the program goes out of the [0x08048434, 0x08048451) address range", then the RSP traffic can be reduced down to: --> vCont;r8048434,8048451:p2db0.2db0;c <-- T0505:68efffbf;04:30efffbf;08:51840408;thread:p2db0.2db0;core:1; As number of packets is reduced dramatically, the performance of stepping source lines is much improved. In case something is wrong with range stepping on the stub side, the debug info or even gdb, this adds a "set/show range-stepping" command to be able to turn range stepping off. gdb/ 2013-05-23 Yao Qi Pedro Alves * gdbthread.h (struct thread_control_state) : New field. * infcmd.c (step_once, until_next_command): Enable range stepping. * infrun.c (displaced_step_prepare): Disable range stepping. (resume): Disable range stepping if stepping over a breakpoint or we have software watchpoints. If range stepping is enabled, assert the thread is in the stepping range. (clear_proceed_status_thread): Clear may_range_step. (handle_inferior_event): Disable range stepping as soon as we know the thread that hit the event. Re-enable it whenever we're going to step with a step range. * remote.c (struct vCont_action_support) : New field. (use_range_stepping): New global. (remote_vcont_probe): Handle 'r' action. (append_resumption): Append an 'r' action if the thread may range step. (show_range_stepping): New function. (set_range_stepping): New function. (_initialize_remote): Call add_setshow_boolean_cmd to register the 'set range-stepping' and 'show range-stepping' commands. * NEWS: Mention range stepping, the new vCont;r action, and the new "set/show range-stepping" commands. gdb/doc/ 2013-05-23 Yao Qi Pedro Alves * gdb.texinfo (Packets): Document 'vCont;r'. (Continuing and Stepping): Document target-assisted range stepping, and the 'set range-stepping' and 'show range-stepping' commands. commit 7ac839d2ea970056e05eb9aabfa2925c6c9d6a13 Author: Pedro Alves Date: Thu May 23 17:13:56 2013 +0000 Convert rs->support_vCont_t to a struct. Convert the 'support_vCont_t' int field to a struct, in preparation for adding more fields to it. gdb/ 2013-05-23 Yao Qi Pedro Alves * remote.c (struct vCont_action_support): New struct. (struct remote_state) : Remove field. : New field. (remote_vcont_probe, remote_stop_ns): Update. commit 34d2892f76ba085447dad2041ebace48815a45fc Author: Pedro Alves Date: Thu May 23 17:12:50 2013 +0000 Factor out in-stepping-range checks. This adds a function for doing within-thread's-stepping-range checks, and converts a couple spots to use it. Following patches will add more uses. gdb/ 2013-05-23 Yao Qi Pedro Alves * gdbthread.h (pc_in_thread_step_range): New declaration. * thread.c (pc_in_thread_step_range): New function. * infrun.c (handle_inferior_event): Use it. commit 79aeb20ca9af9669fca91eb85950f816bbe8a4e9 Author: Andreas Krebbel Date: Thu May 23 15:48:47 2013 +0000 2013-05-23 Andreas Krebbel * s390-opc.c: Fix length operand in RSL_LRDFU and RSL_LRDFEU instruction format. 2013-05-23 Andreas Krebbel * gas/s390/zarch-zEC12.d: Adjust length operands for cdzt, cxzt, czdt, and czxt. * gas/s390/zarch-zEC12.d: Likewise. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 99 ++++ bfd/bfd-in2.h | 8 +- bfd/cache.c | 38 +- bfd/config.in | 6 + bfd/configure | 12 +- bfd/configure.in | 4 +- bfd/dwarf2.c | 148 +++++- bfd/elf32-vax.c | 19 +- bfd/elf64-aarch64.c | 91 +--- bfd/elfxx-mips.c | 2 +- bfd/format.c | 22 +- bfd/libbfd.h | 4 +- bfd/opncls.c | 189 +++++-- bfd/reloc.c | 4 +- bfd/srec.c | 7 +- bfd/sysdep.h | 4 + bfd/version.h | 2 +- gdb/ChangeLog | 695 +++++++++++++++++++++++ gdb/Makefile.in | 5 +- gdb/NEWS | 36 ++ gdb/aarch64-tdep.c | 2 - gdb/acinclude.m4 | 2 +- gdb/ada-lang.c | 43 +- gdb/breakpoint.c | 11 +- gdb/breakpoint.h | 1 + gdb/c-valprint.c | 24 +- gdb/common/filestuff.c | 10 +- gdb/config.in | 3 + gdb/configure | 241 ++++++++- gdb/configure.ac | 15 +- gdb/contrib/cc-with-tweaks.sh | 11 +- gdb/data-directory/Makefile.in | 58 ++- gdb/doc/ChangeLog | 33 ++ gdb/doc/gdb.texinfo | 175 ++++++- gdb/dwarf2read.c | 445 +++++++++++++-- gdb/features/Makefile | 2 +- gdb/features/aarch64-without-fpu.c | 54 -- gdb/features/aarch64-without-fpu.xml | 13 - gdb/frame.c | 101 +++- gdb/gdbserver/ChangeLog | 67 +++ gdb/gdbserver/Makefile.in | 4 +- gdb/gdbserver/configure.srv | 3 +- gdb/gdbserver/i386-low.c | 2 +- gdb/gdbserver/linux-aarch64-low.c | 3 - gdb/gdbserver/linux-low.c | 63 ++- gdb/gdbserver/linux-low.h | 8 + gdb/gdbserver/linux-x86-low.c | 7 + gdb/gdbserver/lynx-low.c | 58 ++- gdb/gdbserver/server.c | 23 +- gdb/gdbserver/target.h | 15 + gdb/gdbthread.h | 12 + gdb/infcmd.c | 8 +- gdb/inferior.c | 4 +- gdb/infrun.c | 39 ++- gdb/mi/mi-cmd-break.c | 164 +++++- gdb/mi/mi-cmds.c | 5 +- gdb/mi/mi-cmds.h | 1 + gdb/mi/mi-main.c | 6 +- gdb/ppc-linux-nat.c | 19 +- gdb/psymtab.c | 45 +- gdb/python/py-arch.c | 16 +- gdb/python/py-auto-load.c | 4 +- gdb/python/py-block.c | 19 +- gdb/python/py-bpevent.c | 3 +- gdb/python/py-breakpoint.c | 18 +- gdb/python/py-cmd.c | 79 ++- gdb/python/py-continueevent.c | 3 +- gdb/python/py-event.c | 27 +- gdb/python/py-event.h | 21 +- gdb/python/py-events.h | 3 +- gdb/python/py-evtregistry.c | 17 +- gdb/python/py-evts.c | 47 +- gdb/python/py-exitedevent.c | 3 +- gdb/python/py-finishbreakpoint.c | 25 +- gdb/python/py-frame.c | 99 ++-- gdb/python/py-function.c | 27 +- gdb/python/py-gdb-readline.c | 7 +- gdb/python/py-inferior.c | 149 +++--- gdb/python/py-infthread.c | 12 +- gdb/python/py-lazy-string.c | 8 +- gdb/python/py-newobjfileevent.c | 3 +- gdb/python/py-objfile.c | 12 +- gdb/python/py-param.c | 31 +- gdb/python/py-prettyprint.c | 10 +- gdb/python/py-progspace.c | 12 +- gdb/python/py-signalevent.c | 3 +- gdb/python/py-symbol.c | 82 ++-- gdb/python/py-symtab.c | 36 +- gdb/python/py-threadevent.c | 3 + gdb/python/py-type.c | 64 +-- gdb/python/py-utils.c | 49 ++- gdb/python/py-value.c | 21 +- gdb/python/python-internal.h | 198 +++++-- gdb/python/python.c | 173 ++++-- gdb/regformats/aarch64-without-fpu.dat | 38 -- gdb/remote.c | 168 +++++- gdb/rs6000-aix-tdep.c | 88 ++-- gdb/solib-svr4.c | 3 +- gdb/solib.c | 32 +- gdb/solib.h | 2 +- gdb/stack.c | 15 +- gdb/stack.h | 2 +- gdb/symmisc.c | 140 +++++ gdb/system-gdbinit/elinos.py | 79 +++ gdb/system-gdbinit/wrs-linux.py | 25 + gdb/testsuite/ChangeLog | 130 +++++ gdb/testsuite/boards/fission-dwp.exp | 49 ++ gdb/testsuite/boards/remote-stdio-gdbserver.exp | 127 ++++ gdb/testsuite/gdb.ada/float_param.exp | 43 ++ gdb/testsuite/gdb.ada/float_param/foo.adb | 23 + gdb/testsuite/gdb.ada/float_param/pck.adb | 35 ++ gdb/testsuite/gdb.ada/float_param/pck.ads | 31 + gdb/testsuite/gdb.base/catch-signal-fork.c | 58 ++ gdb/testsuite/gdb.base/catch-signal-fork.exp | 43 ++ gdb/testsuite/gdb.base/filesym.exp | 29 +- gdb/testsuite/gdb.base/maint.exp | 100 +--- gdb/testsuite/gdb.base/range-stepping.c | 104 ++++ gdb/testsuite/gdb.base/range-stepping.exp | 245 ++++++++ gdb/testsuite/gdb.base/solib-disc.exp | 2 +- gdb/testsuite/gdb.base/unload.exp | 2 +- gdb/testsuite/gdb.base/watchpoint-solib.exp | 2 +- gdb/testsuite/gdb.cp/class2.cc | 1 + gdb/testsuite/gdb.cp/class2.exp | 4 + gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp | 33 +- gdb/testsuite/gdb.dwarf2/implptrconst.exp | 2 +- gdb/testsuite/gdb.dwarf2/method-ptr.exp | 2 +- gdb/testsuite/gdb.dwarf2/missing-sig-type.exp | 4 +- gdb/testsuite/gdb.dwarf2/nostaticblock.exp | 2 +- gdb/testsuite/gdb.dwarf2/subrange.exp | 2 +- gdb/testsuite/gdb.gdb/python-selftest.exp | 30 + gdb/testsuite/gdb.mi/Makefile.in | 2 +- gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp | 2 + gdb/testsuite/gdb.mi/mi-dprintf.c | 59 ++ gdb/testsuite/gdb.mi/mi-dprintf.exp | 163 ++++++ gdb/testsuite/gdb.threads/wp-replication.c | 8 +- gdb/testsuite/gdb.trace/range-stepping.c | 56 ++ gdb/testsuite/gdb.trace/range-stepping.exp | 85 +++ gdb/testsuite/gdb.trace/tfile.exp | 3 + gdb/testsuite/lib/dwarf.exp | 144 ++++-- gdb/testsuite/lib/range-stepping-support.exp | 54 ++ gdb/thread.c | 7 + gdb/tracepoint.c | 41 +- gdb/tracepoint.h | 2 +- gdb/ui-out.c | 44 ++- gdb/varobj.c | 186 ++++--- gdb/version.in | 2 +- gdb/windows-nat.c | 2 +- include/elf/ChangeLog | 15 + include/elf/aarch64.h | 4 +- include/elf/common.h | 5 + include/opcode/ChangeLog | 4 + include/opcode/mips.h | 2 + opcodes/ChangeLog | 44 ++ opcodes/ia64-asmtab.c | 10 +- opcodes/ia64-raw.tbl | 8 +- opcodes/ia64-waw.tbl | 2 +- opcodes/mips-opc.c | 27 +- opcodes/ppc-dis.c | 5 +- opcodes/ppc-opc.c | 177 ++++++- opcodes/s390-opc.c | 4 +- opcodes/s390-opc.txt | 2 +- readline/ChangeLog.gdb | 6 + readline/configure | 3 +- readline/configure.in | 3 +- 164 files changed, 5994 insertions(+), 1361 deletions(-) delete mode 100644 gdb/features/aarch64-without-fpu.c delete mode 100644 gdb/features/aarch64-without-fpu.xml delete mode 100644 gdb/regformats/aarch64-without-fpu.dat create mode 100644 gdb/system-gdbinit/elinos.py create mode 100644 gdb/system-gdbinit/wrs-linux.py create mode 100644 gdb/testsuite/boards/fission-dwp.exp create mode 100644 gdb/testsuite/boards/remote-stdio-gdbserver.exp create mode 100644 gdb/testsuite/gdb.ada/float_param.exp create mode 100644 gdb/testsuite/gdb.ada/float_param/foo.adb create mode 100644 gdb/testsuite/gdb.ada/float_param/pck.adb create mode 100644 gdb/testsuite/gdb.ada/float_param/pck.ads create mode 100644 gdb/testsuite/gdb.base/catch-signal-fork.c create mode 100644 gdb/testsuite/gdb.base/catch-signal-fork.exp create mode 100644 gdb/testsuite/gdb.base/range-stepping.c create mode 100644 gdb/testsuite/gdb.base/range-stepping.exp create mode 100644 gdb/testsuite/gdb.gdb/python-selftest.exp create mode 100644 gdb/testsuite/gdb.mi/mi-dprintf.c create mode 100644 gdb/testsuite/gdb.mi/mi-dprintf.exp create mode 100644 gdb/testsuite/gdb.trace/range-stepping.c create mode 100644 gdb/testsuite/gdb.trace/range-stepping.exp create mode 100644 gdb/testsuite/lib/range-stepping-support.exp First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e220c63..d1ec430 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,102 @@ +2013-05-29 Nick Clifton + + * dwarf2.c (struct dwarf2_debug): Add fields for handling + alternate debug info source. + (dwarf_debug_sections): Add entries for alternate .debug_str and + .debug_info sections. + (dwarf_debug_section_enum): Likewise. + (read_alt_indirect_string): New function. Handles a + DW_FORM_GNU_strp_alt attribute. + (read_alt_indirect_ref): New function. Handles a + DW_FORM_GNU_ref_alt attribute. + (read_attribute_value): Process DW_FORM_GNU_ref_alt and + DW_FORM_GNU_strp_alt. + (find_abstract_instance_name): Handle DW_FORM_GNU_ref_alt + attributes. + (_bfd_dwarf2_cleanup_debug_info): Free alternate debug info + sources. + * opncls.c (GNU_DEBUGALTLINK): Define. + (bfd_get_alt_debug_link_info): New function. + (separate_alt_debug_file_exists): New function. + (find_separate_debug_file): Add parameters for fetch and check + functions. + (bfd_follow_gnu_debugaltlink): New function. + * bfd-in2.h: Regenerate. + +2013-05-28 Yufeng Zhang + + * reloc.c (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE): Rename to ... + (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21): ... this. + (BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19): Rename to ... + (BFD_RELOC_AARCH64_TLSDESC_LD_PREL19): ... this. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf64-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Update to use + the correct names. + (elf64_aarch64_tlsdesc_howto_table): Likewise. + (elf64_aarch64_reloc_map): Likewise. + (aarch64_resolve_relocation): Likewise. + (bfd_elf_aarch64_put_addend): Likewise. + (aarch64_tls_transition_without_check): Likewise. + (aarch64_reloc_got_type): Likewise. + (elf64_aarch64_final_link_relocate): Likewise. + (elf64_aarch64_tls_relax): Likewise. + (elf64_aarch64_relocate_section): Likewise. + (elf64_aarch64_gc_sweep_hook): Likewise. + (elf64_aarch64_check_relocs): Likewise. + +2013-05-26 Mark Wielaard + + * cache.c (BFD_CACHE_MAX_OPEN): Remove define. + (max_open_files): New static int initialized to zero. + (bfd_cache_max_open): New static function to set and return + max_open_files. + (bfd_cache_init): Use bfd_cache_max_open. + (bfd_open_file): Likewise. + * configure.in (AC_CHECK_HEADERS): Add sys/resource.h. + (AC_CHECK_FUNCS): Add getrlimit. + * configure: Regenerated. + * config.in: Likewise. + * sysdep.h: Check and include sys/resource.h for getrlimit. + +2013-05-23 Alan Modra + + * format.c (bfd_check_format_matches): Don't match a target in + targ_selvecs if some other target is a better match. If + targets implement match priority, fall back to the first of + the best matches. + +2013-05-22 Eric Herman + + PR binutils/15462 + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Warning fix. + +2013-05-22 Ralf Dreesen + + PR binutils/15474 + * srec.c (srec_set_section_contents): Properly convert size + and offset to address when octets_per_byte is not unity. + +2013-05-20 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_instantiate_got_entries): Only set the + refcount member of the gotplt_union when resetting the reference + count. Adjust comment. + +2013-05-20 Will Newton + + * elf64-aarch64.c (elf64_aarch64_link_hash_entry): Remove + relocs_copied member. + (elf64_aarch64_link_hash_newfunc): Remove initialization of + relocs_copied member. + (elf64_aarch64_copy_indirect_symbol): Remove code to copy + relocs_copied member. + +2013-05-19 Maciej W. Rozycki + + * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Convert K&R + function definition. + 2013-05-16 Cary Coutant * ecoff.c (ecoff_link_check_archive_element): Add initializers for diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 0050f46..efc1a55 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1051,8 +1051,12 @@ unsigned long bfd_calc_gnu_debuglink_crc32 char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); +char *bfd_get_alt_debug_link_info (bfd *abfd, unsigned long *crc32_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); @@ -5350,7 +5354,7 @@ of a signed or unsigned address/value. */ BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, /* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, /* AArch64 TLS DESC relocation. */ BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, @@ -5362,7 +5366,7 @@ of a signed or unsigned address/value. */ BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, /* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, /* AArch64 TLS DESC relocation. */ BFD_RELOC_AARCH64_TLSDESC_LDR, diff --git a/bfd/cache.c b/bfd/cache.c index 5226816..4d46936 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -31,7 +31,7 @@ SECTION regard to the underlying operating system's file descriptor limit (often as low as 20 open files). The module in <> maintains a least recently used list of - <> files, and exports the name + <> files, and exports the name <>, which runs around and makes sure that the required BFD is open. If not, then it chooses a file to close, closes it and opens the one wanted, returning its file @@ -67,9 +67,35 @@ enum cache_flag { }; /* The maximum number of files which the cache will keep open at - one time. */ + one time. When needed call bfd_cache_max_open to initialize. */ -#define BFD_CACHE_MAX_OPEN 10 +static int max_open_files = 0; + +/* Set max_open_files, if not already set, to 12.5% of the allowed open + file descriptors, but at least 10, and return the value. */ +static int +bfd_cache_max_open (void) +{ + if (max_open_files == 0) + { + int max; +#ifdef HAVE_GETRLIMIT + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && rlim.rlim_cur != RLIM_INFINITY) + max = rlim.rlim_cur / 8; + else +#endif /* HAVE_GETRLIMIT */ +#ifdef _SC_OPEN_MAX + max = sysconf (_SC_OPEN_MAX) / 8; +#else + max = 10; +#endif /* _SC_OPEN_MAX */ + max_open_files = max < 10 ? 10 : max; + } + + return max_open_files; +} /* The number of BFD files we have open. */ @@ -187,7 +213,7 @@ close_one (void) /* Called when the macro <> fails to find a quick answer. Find a file descriptor for @var{abfd}. If necessary, it open it. If there are already more than - <> files open, it tries to close one first, to + <> files open, it tries to close one first, to avoid running out of file descriptors. It will return NULL if it is unable to (re)open the @var{abfd}. */ @@ -466,7 +492,7 @@ bfd_boolean bfd_cache_init (bfd *abfd) { BFD_ASSERT (abfd->iostream != NULL); - if (open_files >= BFD_CACHE_MAX_OPEN) + if (open_files >= bfd_cache_max_open ()) { if (! close_one ()) return FALSE; @@ -553,7 +579,7 @@ bfd_open_file (bfd *abfd) { abfd->cacheable = TRUE; /* Allow it to be closed later. */ - if (open_files >= BFD_CACHE_MAX_OPEN) + if (open_files >= bfd_cache_max_open ()) { if (! close_one ()) return NULL; diff --git a/bfd/config.in b/bfd/config.in index 2fc4897..65fb044 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -112,6 +112,9 @@ /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE +/* Define to 1 if you have the `getrlimit' function. */ +#undef HAVE_GETRLIMIT + /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID @@ -234,6 +237,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCFS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H diff --git a/bfd/configure b/bfd/configure index 5fc08e4..090f981 100755 --- a/bfd/configure +++ b/bfd/configure @@ -12908,7 +12908,7 @@ fi done -for ac_header in fcntl.h sys/file.h sys/time.h sys/stat.h +for ac_header in fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -13583,12 +13583,14 @@ _ACEOF fi done -for ac_func in strtoull +for ac_func in strtoull getrlimit do : - ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" -if test "x$ac_cv_func_strtoull" = x""yes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOULL 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi diff --git a/bfd/configure.in b/bfd/configure.in index befcf27..ff14270 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -211,7 +211,7 @@ AC_SUBST(BFD_HOSTPTR_T) BFD_CC_FOR_BUILD AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h) -AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h) +AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h) GCC_HEADER_STDINT(bfd_stdint.h) AC_HEADER_TIME AC_HEADER_DIRENT @@ -220,7 +220,7 @@ AC_CHECK_HEADERS(windows.h dlfcn.h) ACX_HEADER_STRING AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno) -AC_CHECK_FUNCS(strtoull) +AC_CHECK_FUNCS(strtoull getrlimit) AC_CHECK_DECLS(basename) AC_CHECK_DECLS(ftello) diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 7a1a4ae..c9349da 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -1,6 +1,5 @@ /* DWARF 2 support. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 1994-2013 Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -108,6 +107,16 @@ struct dwarf2_debug asection *sec; bfd_byte *sec_info_ptr; + /* Support for alternate debug info sections created by the DWZ utility: + This includes a pointer to an alternate bfd which contains *extra*, + possibly duplicate debug sections, and pointers to the loaded + .debug_str and .debug_info sections from this bfd. */ + bfd * alt_bfd_ptr; + bfd_byte * alt_dwarf_str_buffer; + bfd_size_type alt_dwarf_str_size; + bfd_byte * alt_dwarf_info_buffer; + bfd_size_type alt_dwarf_info_size; + /* A pointer to the memory block allocated for info_ptr. Neither info_ptr nor sec_info_ptr are guaranteed to stay pointing to the beginning of the malloc block. This is used only to free the @@ -290,6 +299,7 @@ const struct dwarf_debug_section dwarf_debug_sections[] = { ".debug_aranges", ".zdebug_aranges" }, { ".debug_frame", ".zdebug_frame" }, { ".debug_info", ".zdebug_info" }, + { ".debug_info", ".zdebug_info" }, { ".debug_line", ".zdebug_line" }, { ".debug_loc", ".zdebug_loc" }, { ".debug_macinfo", ".zdebug_macinfo" }, @@ -300,6 +310,7 @@ const struct dwarf_debug_section dwarf_debug_sections[] = { ".debug_static_func", ".zdebug_static_func" }, { ".debug_static_vars", ".zdebug_static_vars" }, { ".debug_str", ".zdebug_str", }, + { ".debug_str", ".zdebug_str", }, { ".debug_types", ".zdebug_types" }, /* GNU DWARF 1 extensions */ { ".debug_sfnames", ".zdebug_sfnames" }, @@ -312,12 +323,15 @@ const struct dwarf_debug_section dwarf_debug_sections[] = { NULL, NULL }, }; +/* NB/ Numbers in this enum must match up with indicies + into the dwarf_debug_sections[] array above. */ enum dwarf_debug_section_enum { debug_abbrev = 0, debug_aranges, debug_frame, debug_info, + debug_info_alt, debug_line, debug_loc, debug_macinfo, @@ -328,6 +342,7 @@ enum dwarf_debug_section_enum debug_static_func, debug_static_vars, debug_str, + debug_str_alt, debug_types, debug_sfnames, debug_srcinfo, @@ -484,8 +499,8 @@ read_section (bfd * abfd, asection *msec; const char *section_name = sec->uncompressed_name; - /* read_section is a noop if the section has already been read. */ - if (!*section_buffer) + /* The section may have already been read. */ + if (*section_buffer == NULL) { msec = bfd_get_section_by_name (abfd, section_name); if (! msec) @@ -626,6 +641,104 @@ read_indirect_string (struct comp_unit * unit, return str; } +/* Like read_indirect_string but uses a .debug_str located in + an alternate filepointed to by the .gnu_debuglink section. + Used to impement DW_FORM_GNU_strp_alt. */ + +static char * +read_alt_indirect_string (struct comp_unit * unit, + bfd_byte * buf, + unsigned int * bytes_read_ptr) +{ + bfd_uint64_t offset; + struct dwarf2_debug *stash = unit->stash; + char *str; + + if (unit->offset_size == 4) + offset = read_4_bytes (unit->abfd, buf); + else + offset = read_8_bytes (unit->abfd, buf); + + *bytes_read_ptr = unit->offset_size; + + if (stash->alt_bfd_ptr == NULL) + { + bfd * debug_bfd; + char * debug_filename = bfd_follow_gnu_debugaltlink (unit->abfd, DEBUGDIR); + + if (debug_filename == NULL) + return NULL; + + if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL + || ! bfd_check_format (debug_bfd, bfd_object)) + { + if (debug_bfd) + bfd_close (debug_bfd); + + /* FIXME: Should we report our failure to follow the debuglink ? */ + free (debug_filename); + return NULL; + } + stash->alt_bfd_ptr = debug_bfd; + } + + if (! read_section (unit->stash->alt_bfd_ptr, + stash->debug_sections + debug_str_alt, + NULL, /* FIXME: Do we need to load alternate symbols ? */ + offset, + &stash->alt_dwarf_str_buffer, + &stash->alt_dwarf_str_size)) + return NULL; + + str = (char *) stash->alt_dwarf_str_buffer + offset; + if (*str == '\0') + return NULL; + + return str; +} + +/* Resolve an alternate reference from UNIT at OFFSET. + Returns a pointer into the loaded alternate CU upon success + or NULL upon failure. */ + +static bfd_byte * +read_alt_indirect_ref (struct comp_unit * unit, + bfd_uint64_t offset) +{ + struct dwarf2_debug *stash = unit->stash; + + if (stash->alt_bfd_ptr == NULL) + { + bfd * debug_bfd; + char * debug_filename = bfd_follow_gnu_debugaltlink (unit->abfd, DEBUGDIR); + + if (debug_filename == NULL) + return FALSE; + + if ((debug_bfd = bfd_openr (debug_filename, NULL)) == NULL + || ! bfd_check_format (debug_bfd, bfd_object)) + { + if (debug_bfd) + bfd_close (debug_bfd); + + /* FIXME: Should we report our failure to follow the debuglink ? */ + free (debug_filename); + return NULL; + } + stash->alt_bfd_ptr = debug_bfd; + } + + if (! read_section (unit->stash->alt_bfd_ptr, + stash->debug_sections + debug_info_alt, + NULL, /* FIXME: Do we need to load alternate symbols ? */ + offset, + &stash->alt_dwarf_info_buffer, + &stash->alt_dwarf_info_size)) + return NULL; + + return stash->alt_dwarf_info_buffer + offset; +} + static bfd_uint64_t read_address (struct comp_unit *unit, bfd_byte *buf) { @@ -829,6 +942,7 @@ read_attribute_value (struct attribute *attr, attr->u.val = read_address (unit, info_ptr); info_ptr += unit->addr_size; break; + case DW_FORM_GNU_ref_alt: case DW_FORM_sec_offset: if (unit->offset_size == 4) attr->u.val = read_4_bytes (unit->abfd, info_ptr); @@ -878,6 +992,10 @@ read_attribute_value (struct attribute *attr, attr->u.str = read_indirect_string (unit, info_ptr, &bytes_read); info_ptr += bytes_read; break; + case DW_FORM_GNU_strp_alt: + attr->u.str = read_alt_indirect_string (unit, info_ptr, &bytes_read); + info_ptr += bytes_read; + break; case DW_FORM_exprloc: hooks/post-receive -- Repository for Project Archer.