From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20912 invoked by alias); 25 Jan 2013 20:49:15 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 20835 invoked by uid 9674); 25 Jan 2013 20:49:10 -0000 Date: Fri, 25 Jan 2013 20:49:00 -0000 Message-ID: <20130125204910.20819.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-absdir: Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel X-Git-Refname: refs/heads/archer-jankratochvil-absdir X-Git-Reftype: branch X-Git-Oldrev: 66404891ed57a7c2c143184abb8857dd49d8700a X-Git-Newrev: e1d8b124013f2e544aa8ff2498b9c62b0ad1b893 X-SW-Source: 2013-q1/txt/msg00030.txt.bz2 List-Id: The branch, archer-jankratochvil-absdir has been updated via e1d8b124013f2e544aa8ff2498b9c62b0ad1b893 (commit) via 5709253e10823e9e0a4ac677b455a2252ad37e7d (commit) via 801ff2acba450d39725c5a6f2b28851a97342806 (commit) via eeac9993e2c505c636c6eeb110f2f7bca96b937e (commit) via f9f3f4cfa117f28b4723f4ea31777f934f887afa (commit) via bac553a2c45a02f8aef898a4d60c5aaffddc4a58 (commit) via f832a313975300cf9ee0a6fc7a13d7fa2e97300b (commit) via ace21a8cf5d94b326d5e0d23d6d51f80b17daea8 (commit) via e836016a7968d906a9264518686e58a7e325679c (commit) via 03535480b30ae7a358cbb38003ef193eea7a6585 (commit) via 29fa431507af6ba23ded072f2301830f5350160b (commit) via bc75a9424b6e11f4317a0b6af9b5a164ceb3036b (commit) via d3ec4921e869f73a725fee32c6a8f3cd80596434 (commit) via 8019658a7c1c851c7f2d1f2f8d34f5e630f93e8f (commit) via cacebf6a579a78e9b1903ba47a3c2d1766e487bb (commit) via c5240c297977247c20962cd802ce780f13f9e9ef (commit) via 917d6ef0a049f6743f85f22bae5d8cf9ebbc3bb1 (commit) via e50bab8c19cf44acfae1e3a77ddc1f96db076f96 (commit) via a235afe250c5de00e50e6db875f081078ba1d7ae (commit) via 8976d356d75a1f22a41cae4f79174f9c3db15f8f (commit) via 7213e204be9a0d2fe6cec8abb703f3864a962103 (commit) via 6452e45e1eb1d0c03dca02c5a1748a39d8ae3f42 (commit) via 29c433f48429eb272ab8b1811cd15c1b558e6a64 (commit) via 3f7fe34a155b631c7f9a4c68f0608f6ca75bc6a1 (commit) via c704a22c21d3004ab9c1d782d382fb48076ba952 (commit) via 5a67724227e4d5ad19ae63f6a7aad656870063b8 (commit) via d4a25db736df72245377aefbc68e1cab6cc38e1e (commit) via 9bd3bfe1fbb55b71104fd8ea390b646a4d2f64ac (commit) via 97fb6b2c2692f75d83bca29e43de618af53d3d54 (commit) via a606bd7277c4f71b7a32c5a86043aa3ef717914e (commit) via a0b2071fce6d8f1fa573dbec03e31e148660800a (commit) via 6275a3f4dbbb0c4f1b34d77737cf4ae803e4e86e (commit) via 5f97c0604bceb06335930ce875df6ea83f46c321 (commit) via d2319e397934af9f57059509b30b6404f67c37fc (commit) via 5708ea0f50ecfcd70e12bcd904ba5e75e3c1edcb (commit) via 307c0cf307a7638627f73bb7e42691fe78ed11d9 (commit) via cb85ff9379203bf7f43f8412e6d6b34d446a91bf (commit) via ce12fee1db27f3fef3b6d7cc2665f63c611548d8 (commit) via 9a9d320ce75de6a2a938537532ad228fab3a8abe (commit) via 37d919cf67622bdbf5b5fb3f10ce71ac23c1d7d0 (commit) via 3748d0516d134b6b9f727f8dbbc93afb4e137cff (commit) via febdbbf9cb02f4f696e889874d43fea5d4006c2e (commit) from 66404891ed57a7c2c143184abb8857dd49d8700a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit e1d8b124013f2e544aa8ff2498b9c62b0ad1b893 Merge: bc75a94 5709253 Author: Jan Kratochvil Date: Fri Jan 25 21:48:51 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel commit 5709253e10823e9e0a4ac677b455a2252ad37e7d Merge: d3ec492 801ff2a Author: Jan Kratochvil Date: Fri Jan 25 21:48:51 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal commit 801ff2acba450d39725c5a6f2b28851a97342806 Merge: 8019658 eeac999 Author: Jan Kratochvil Date: Fri Jan 25 21:48:50 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab commit eeac9993e2c505c636c6eeb110f2f7bca96b937e Merge: 5a67724 f9f3f4c Author: Jan Kratochvil Date: Fri Jan 25 21:48:50 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui commit f9f3f4cfa117f28b4723f4ea31777f934f887afa Merge: 6275a3f bac553a Author: Jan Kratochvil Date: Fri Jan 25 21:48:50 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2 commit bac553a2c45a02f8aef898a4d60c5aaffddc4a58 Merge: 2063558 f832a31 Author: Jan Kratochvil Date: Fri Jan 25 21:48:49 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config commit f832a313975300cf9ee0a6fc7a13d7fa2e97300b Merge: 9647d22 ace21a8 Author: Jan Kratochvil Date: Fri Jan 25 21:48:49 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname' into xfullpath-locsymtab-isabs-expandfullname-tuifullname commit ace21a8cf5d94b326d5e0d23d6d51f80b17daea8 Merge: ba06d0f e836016 Author: Jan Kratochvil Date: Fri Jan 25 21:48:49 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs' into xfullpath-locsymtab-isabs-expandfullname commit e836016a7968d906a9264518686e58a7e325679c Merge: e803707 0353548 Author: Jan Kratochvil Date: Fri Jan 25 21:48:48 2013 +0100 Merge branch 'xfullpath-locsymtab' into xfullpath-locsymtab-isabs commit 03535480b30ae7a358cbb38003ef193eea7a6585 Merge: d39625f 29fa431 Author: Jan Kratochvil Date: Fri Jan 25 21:48:48 2013 +0100 Merge branch 'xfullpath' into xfullpath-locsymtab commit 29fa431507af6ba23ded072f2301830f5350160b Merge: 76d10fd 5708ea0 Author: Jan Kratochvil Date: Fri Jan 25 21:48:48 2013 +0100 Merge remote-tracking branch 'gdb/master' into xfullpath commit bc75a9424b6e11f4317a0b6af9b5a164ceb3036b Merge: cacebf6 d3ec492 Author: Jan Kratochvil Date: Fri Jan 25 21:48:21 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel commit d3ec4921e869f73a725fee32c6a8f3cd80596434 Merge: c5240c2 8019658 Author: Jan Kratochvil Date: Fri Jan 25 21:48:20 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal commit 8019658a7c1c851c7f2d1f2f8d34f5e630f93e8f Author: Jan Kratochvil Date: Fri Jan 25 21:48:16 2013 +0100 . commit cacebf6a579a78e9b1903ba47a3c2d1766e487bb Merge: e50bab8 c5240c2 Author: Jan Kratochvil Date: Fri Jan 25 21:40:50 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel commit c5240c297977247c20962cd802ce780f13f9e9ef Merge: a235afe 917d6ef Author: Jan Kratochvil Date: Fri Jan 25 21:40:50 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal commit 917d6ef0a049f6743f85f22bae5d8cf9ebbc3bb1 Author: Jan Kratochvil Date: Fri Jan 25 21:40:44 2013 +0100 . commit e50bab8c19cf44acfae1e3a77ddc1f96db076f96 Merge: 8976d35 a235afe Author: Jan Kratochvil Date: Fri Jan 25 21:26:44 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel commit a235afe250c5de00e50e6db875f081078ba1d7ae Author: Jan Kratochvil Date: Fri Jan 25 21:26:37 2013 +0100 . commit 8976d356d75a1f22a41cae4f79174f9c3db15f8f Merge: 29c433f 7213e20 Author: Jan Kratochvil Date: Fri Jan 25 21:21:56 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel commit 7213e204be9a0d2fe6cec8abb703f3864a962103 Merge: 3f7fe34 6452e45 Author: Jan Kratochvil Date: Fri Jan 25 21:21:55 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal commit 6452e45e1eb1d0c03dca02c5a1748a39d8ae3f42 Author: Jan Kratochvil Date: Fri Jan 25 21:21:46 2013 +0100 . commit 29c433f48429eb272ab8b1811cd15c1b558e6a64 Merge: d4a25db 3f7fe34 Author: Jan Kratochvil Date: Fri Jan 25 21:04:34 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel commit 3f7fe34a155b631c7f9a4c68f0608f6ca75bc6a1 Merge: 9bd3bfe c704a22 Author: Jan Kratochvil Date: Fri Jan 25 21:04:09 2013 +0100 . commit c704a22c21d3004ab9c1d782d382fb48076ba952 Merge: 97fb6b2 5a67724 Author: Jan Kratochvil Date: Fri Jan 25 21:03:26 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab commit 5a67724227e4d5ad19ae63f6a7aad656870063b8 Author: Jan Kratochvil Date: Fri Jan 25 21:03:18 2013 +0100 . commit d4a25db736df72245377aefbc68e1cab6cc38e1e Merge: 6640489 9bd3bfe Author: Jan Kratochvil Date: Fri Jan 25 20:22:02 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal-macrorel commit 9bd3bfe1fbb55b71104fd8ea390b646a4d2f64ac Merge: 33a1bcf 97fb6b2 Author: Jan Kratochvil Date: Fri Jan 25 20:22:01 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab-dw2fullreal commit 97fb6b2c2692f75d83bca29e43de618af53d3d54 Merge: 04177ea a606bd7 Author: Jan Kratochvil Date: Fri Jan 25 20:22:01 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui-psymtab commit a606bd7277c4f71b7a32c5a86043aa3ef717914e Author: Jan Kratochvil Date: Fri Jan 25 20:18:54 2013 +0100 Revert "." This reverts commit 6275a3f4dbbb0c4f1b34d77737cf4ae803e4e86e. commit a0b2071fce6d8f1fa573dbec03e31e148660800a Merge: 9b37dd4 6275a3f Author: Jan Kratochvil Date: Fri Jan 25 20:18:48 2013 +0100 Merge branch 'xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2' into xfullpath-locsymtab-isabs-expandfullname-tuifullname-config-simple2-tui commit 6275a3f4dbbb0c4f1b34d77737cf4ae803e4e86e Author: Jan Kratochvil Date: Fri Jan 25 20:18:32 2013 +0100 . commit 5f97c0604bceb06335930ce875df6ea83f46c321 Author: Jan Kratochvil Date: Fri Jan 25 20:12:51 2013 +0100 . commit d2319e397934af9f57059509b30b6404f67c37fc Author: Jan Kratochvil Date: Fri Jan 25 20:03:41 2013 +0100 . commit 5708ea0f50ecfcd70e12bcd904ba5e75e3c1edcb Author: Tom Tromey Date: Fri Jan 25 17:59:28 2013 +0000 * gdb.python/py-explore.exp: Expect the gdb prompt. commit 307c0cf307a7638627f73bb7e42691fe78ed11d9 Author: Tom Tromey Date: Fri Jan 25 17:57:30 2013 +0000 * dwarf2read.c (processing_has_namespace_info): Remove. (struct dwarf2_cu) : New field. (process_die, read_func_scope, dwarf2_start_symtab) (new_symbol_full): Update. commit cb85ff9379203bf7f43f8412e6d6b34d446a91bf Author: Tom Tromey Date: Fri Jan 25 17:55:21 2013 +0000 * cp-namespace.c (cp_set_block_scope): Remove. * cp-support.h (cp_set_block_scope): Remove. * dbxread.c: Include block.h. (cp_set_block_scope): New function. (process_one_symbol): Update. * dwarf2read.c (read_func_scope): Use block_set_scope. commit ce12fee1db27f3fef3b6d7cc2665f63c611548d8 Author: Pedro Alves Date: Fri Jan 25 17:38:00 2013 +0000 Fix add_current_inferior_and_thread's describing comment. add_current_inferior_and_thread tries the stop reply first. Tweak its comment to reflect reality. 2013-01-25 Pedro Alves * remote.c (add_current_inferior_and_thread): Tweak comment. commit 9a9d320ce75de6a2a938537532ad228fab3a8abe Author: Tom Tromey Date: Fri Jan 25 17:36:01 2013 +0000 * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (cp_add_using_directive): Add 'copy_names' argument. * cp-support.h (cp_add_using_directive): Update. (struct using_direct) : Now const. * dwarf2read.c (read_import_statement): Use obconcat. Don't copy names passed to cp_add_using_directive. commit 37d919cf67622bdbf5b5fb3f10ce71ac23c1d7d0 Author: Tom Tromey Date: Fri Jan 25 17:34:01 2013 +0000 * c-exp.y (qualified_name): Use TYPE_SAFE_NAME. commit 3748d0516d134b6b9f727f8dbbc93afb4e137cff Author: Pedro Alves Date: Fri Jan 25 17:25:55 2013 +0000 Fix GDB internal error against targets that return a thread in T stop replies but don't support qC. Yao writes: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GDB gets an internal error when it connects to GDBserver started with '--disable-packet=qC'. Sending packet: $QNonStop:0#8c...Packet received: OK Sending packet: $?#3f...Packet received: T0505:00000000;04:00f0ffbf;08:b0c2e44c;thread:p4255.4255;core:1; Sending packet: $Hc-1#09...Packet received: E01 Sending packet: $qC#b4...Packet received: Sending packet: $qAttached:a410#bf...Packet received: E01 Packet qAttached (query-attached) is supported warning: Remote failure reply: E01 Sending packet: $qOffsets#4b...Packet received: ../../../git/gdb/target.c:3248: internal-error: Can't determine the current address space of thread Thread 16981 When start remote, the call chain is as follows, remote_start_remote add_current_inferior_and_thread <--[1] ... start_remote wait_for_inferior remote_wait_as process_stop_reply get_thread_arch_regcache <--[2] remote_notice_new_inferior <--[3] GDB sends packet "qC" in [1] and adds the thread/inferior if the remote stubs understands "qC". In [2], GDB looks for the inferior to build a regcache, and notices a new inferior in [3]. As we can see, GDB assumes that the inferior can be found in [2]. Once the remote stub doesn't support "qC", GDB can't look for the inferior in [2], and emits an internal error. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Right after the initial connection, we query the target for its state, with the ? packet. We store the resulting wait status / stop reply aside, and query the target for the current thread, using qC, which fails, so we fake a ptid for the target's thread. We then later, after the initial setup, end up consuming that set-aside wait status, parsing the T stop reply, which contains a "thread" "register" (which was the thread the target would have replied to qC). We get into trouble because the ptid in that stop reply doesn't match our faked up ptid in the initial setup, although the target threads are the same... So we had the T stop reply handy all along. We might as well extract the thread's ptid from it, and avoid all the resulting issues. qC is also used after vRun, in order to discover the new process'es main thread. But, vRun's reply is also a wait status, just like '?''s, which is quite convenient. This means that if we have a "Txx thread: ptid" reply, then we don't really need qC. The patch makes GDB look in the T reply first, and if not found, try with qC. The packet handling seems to have been added in gdb-4.18 (1999), and I see that in that same release, "Txx thread: ptid" didn't exist yet, which probably explains why nobody though of doing this before. Regression tested against a gdbserver with qC disabled (and then enabled), on x86_64 Fedora 17. 2013-01-25 Pedro Alves * remote.c (stop_reply_extract_thread): New. (add_current_inferior_and_thread): New parameter 'wait_status'. Handle it. (remote_start_remote): Pass wait status to add_current_inferior_and_thread. (extended_remote_run): Update comment. (extended_remote_create_inferior_1): Pass wait status to add_current_inferior_and_thread. commit febdbbf9cb02f4f696e889874d43fea5d4006c2e Author: aburgess Date: Fri Jan 25 17:16:32 2013 +0000 http://sourceware.org/ml/gdb-patches/2012-11/msg00312.html gdb/ChangeLog * valarith.c (value_vector_widen): New function for replicating a scalar into a vector. (value_binop): Use value_vector_widen to widen scalar to vector rather than casting, this better matches gcc C behaviour. * valops.c (value_casst): Update logic for casting between vector types, and for casting from scalar to vector, try to match gcc C behaviour. * value.h (value_vector_widen): Declare. * opencl-lang.c (opencl_value_cast): New opencl specific casting function, handle special case for casting scalar to vector. (opencl_relop): Use opencl_value_cast. (evaluate_subexp_opencl): Use opencl_value_cast instead of value_cast, and handle BINOP_ASSIGN, UNOP_CAST, and UNOP_CAST_TYPE in order to use opencl_value_cast. gdb/testsuite/ChangeLog * gdb.base/gnu_vector.c: New variable for use in tests. * gdb.base/gnu_vector.exp: Update and extend tests to reflect changes in scalar to vector casting and widening. * gdb.python/py-type.c: New variables for use in tests. * gdb.python/py-type.exp: Update vector related tests to reflect changes in scalar to vector casting and widening. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 63 ++++++++++++++++++++ gdb/c-exp.y | 6 +- gdb/cp-namespace.c | 67 +++++++-------------- gdb/cp-support.h | 15 ++--- gdb/dbxread.c | 35 ++++++++++- gdb/dwarf2read.c | 48 +++++++-------- gdb/macroscope.c | 1 - gdb/opencl-lang.c | 98 ++++++++++++++++++++++++++++++- gdb/psymtab.c | 12 +++- gdb/remote.c | 80 ++++++++++++++++++++++--- gdb/skip.c | 9 +++ gdb/symtab.c | 21 +++++-- gdb/testsuite/ChangeLog | 13 ++++ gdb/testsuite/gdb.base/gnu_vector.c | 1 + gdb/testsuite/gdb.base/gnu_vector.exp | 56 +++++++++++++----- gdb/testsuite/gdb.python/py-explore.exp | 2 +- gdb/testsuite/gdb.python/py-type.c | 3 + gdb/testsuite/gdb.python/py-type.exp | 25 +++++---- gdb/valarith.c | 47 ++++++++++++++- gdb/valops.c | 30 ++------- gdb/value.h | 6 ++ 21 files changed, 476 insertions(+), 162 deletions(-) First 500 lines of diff: diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 23f6f07..d9377cc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,66 @@ +2013-01-25 Tom Tromey + + * dwarf2read.c (processing_has_namespace_info): Remove. + (struct dwarf2_cu) : New field. + (process_die, read_func_scope, dwarf2_start_symtab) + (new_symbol_full): Update. + +2013-01-25 Tom Tromey + + * cp-namespace.c (cp_set_block_scope): Remove. + * cp-support.h (cp_set_block_scope): Remove. + * dbxread.c: Include block.h. + (cp_set_block_scope): New function. + (process_one_symbol): Update. + * dwarf2read.c (read_func_scope): Use block_set_scope. + +2013-01-25 Pedro Alves + + * remote.c (add_current_inferior_and_thread): Tweak comment. + +2013-01-25 Tom Tromey + + * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. + (cp_add_using_directive): Add 'copy_names' argument. + * cp-support.h (cp_add_using_directive): Update. + (struct using_direct) : Now const. + * dwarf2read.c (read_import_statement): Use obconcat. + Don't copy names passed to cp_add_using_directive. + +2013-01-25 Tom Tromey + + * c-exp.y (qualified_name): Use TYPE_SAFE_NAME. + +2013-01-25 Pedro Alves + + * remote.c (stop_reply_extract_thread): New. + (add_current_inferior_and_thread): New parameter 'wait_status'. + Handle it. + (remote_start_remote): Pass wait status to + add_current_inferior_and_thread. + (extended_remote_run): Update comment. + (extended_remote_create_inferior_1): Pass wait status to + add_current_inferior_and_thread. + +2013-01-25 Andrew Burgess + Ulrich Weigand + + * valarith.c (value_vector_widen): New function for replicating a + scalar into a vector. + (value_binop): Use value_vector_widen to widen scalar to vector + rather than casting, this better matches gcc C behaviour. + * valops.c (value_casst): Update logic for casting between vector + types, and for casting from scalar to vector, try to match gcc C + behaviour. + * value.h (value_vector_widen): Declare. + * opencl-lang.c (opencl_value_cast): New opencl specific casting + function, handle special case for casting scalar to vector. + (opencl_relop): Use opencl_value_cast. + (evaluate_subexp_opencl): Use opencl_value_cast instead of + value_cast, and handle BINOP_ASSIGN, UNOP_CAST, and UNOP_CAST_TYPE + in order to use opencl_value_cast. + 2013-01-25 Yao Qi * event-loop.c: Include "queue.h". diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 9847120..d396ae5 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -923,7 +923,7 @@ qualified_name: TYPENAME COLONCOLON name && TYPE_CODE (type) != TYPE_CODE_UNION && TYPE_CODE (type) != TYPE_CODE_NAMESPACE) error (_("`%s' is not defined as an aggregate type."), - TYPE_NAME (type)); + TYPE_SAFE_NAME (type)); write_exp_elt_opcode (OP_SCOPE); write_exp_elt_type (type); @@ -939,7 +939,7 @@ qualified_name: TYPENAME COLONCOLON name && TYPE_CODE (type) != TYPE_CODE_UNION && TYPE_CODE (type) != TYPE_CODE_NAMESPACE) error (_("`%s' is not defined as an aggregate type."), - TYPE_NAME (type)); + TYPE_SAFE_NAME (type)); tmp_token.ptr = (char*) alloca ($4.length + 2); tmp_token.length = $4.length + 1; @@ -959,7 +959,7 @@ qualified_name: TYPENAME COLONCOLON name char *copy = copy_name ($3); error (_("No type \"%s\" within class " "or namespace \"%s\"."), - copy, TYPE_NAME ($1.type)); + copy, TYPE_SAFE_NAME ($1.type)); } ; diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 8511bf1..c137eec 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -96,7 +96,7 @@ cp_scan_for_anonymous_namespaces (const struct symbol *const symbol, anonymous namespace. So add symbols in it to the namespace given by the previous component if there is one, or to the global namespace if there isn't. */ - cp_add_using_directive (dest, src, NULL, NULL, NULL, + cp_add_using_directive (dest, src, NULL, NULL, NULL, 1, &objfile->objfile_obstack); } /* The "+ 2" is for the "::". */ @@ -117,9 +117,10 @@ cp_scan_for_anonymous_namespaces (const struct symbol *const symbol, in the current scope. If ALIAS is NULL then the namespace is known by its original name. DECLARATION is the name if the imported varable if this is a declaration import (Eg. using A::x), otherwise - it is NULL. EXCLUDES is a list of names not to import from an imported - module or NULL. The arguments are copied into newly allocated memory so - they can be temporaries. For EXCLUDES the VEC pointers are copied but the + it is NULL. EXCLUDES is a list of names not to import from an + imported module or NULL. If COPY_NAMES is non-zero, then the + arguments are copied into newly allocated memory so they can be + temporaries. For EXCLUDES the VEC pointers are copied but the pointed to characters are not copied. */ void @@ -128,6 +129,7 @@ cp_add_using_directive (const char *dest, const char *alias, const char *declaration, VEC (const_char_ptr) *excludes, + int copy_names, struct obstack *obstack) { struct using_direct *current; @@ -173,15 +175,27 @@ cp_add_using_directive (const char *dest, * sizeof (*new->excludes)))); memset (new, 0, sizeof (*new)); - new->import_src = obstack_copy0 (obstack, src, strlen (src)); - new->import_dest = obstack_copy0 (obstack, dest, strlen (dest)); + if (copy_names) + { + new->import_src = obstack_copy0 (obstack, src, strlen (src)); + new->import_dest = obstack_copy0 (obstack, dest, strlen (dest)); + } + else + { + new->import_src = src; + new->import_dest = dest; + } - if (alias != NULL) + if (alias != NULL && copy_names) new->alias = obstack_copy0 (obstack, alias, strlen (alias)); + else + new->alias = alias; - if (declaration != NULL) + if (declaration != NULL && copy_names) new->declaration = obstack_copy0 (obstack, declaration, strlen (declaration)); + else + new->declaration = declaration; memcpy (new->excludes, VEC_address (const_char_ptr, excludes), VEC_length (const_char_ptr, excludes) * sizeof (*new->excludes)); @@ -191,43 +205,6 @@ cp_add_using_directive (const char *dest, using_directives = new; } -/* Record the namespace that the function defined by SYMBOL was - defined in, if necessary. BLOCK is the associated block; use - OBSTACK for allocation. */ - -void -cp_set_block_scope (const struct symbol *symbol, - struct block *block, - struct obstack *obstack, - const char *processing_current_prefix, - int processing_has_namespace_info) -{ - if (processing_has_namespace_info) - { - block_set_scope - (block, obstack_copy0 (obstack, processing_current_prefix, - strlen (processing_current_prefix)), - obstack); - } - else if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) - { - /* Try to figure out the appropriate namespace from the - demangled name. */ - - /* FIXME: carlton/2003-04-15: If the function in question is - a method of a class, the name will actually include the - name of the class as well. This should be harmless, but - is a little unfortunate. */ - - const char *name = SYMBOL_DEMANGLED_NAME (symbol); - unsigned int prefix_len = cp_entire_prefix_len (name); - - block_set_scope (block, - obstack_copy0 (obstack, name, prefix_len), - obstack); - } -} - /* Test whether or not NAMESPACE looks like it mentions an anonymous namespace; return nonzero if so. */ diff --git a/gdb/cp-support.h b/gdb/cp-support.h index c22c1e7..c7141d5 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -125,11 +125,11 @@ struct demangle_parse_info struct using_direct { - char *import_src; - char *import_dest; + const char *import_src; + const char *import_dest; - char *alias; - char *declaration; + const char *alias; + const char *declaration; struct using_direct *next; @@ -186,14 +186,9 @@ extern void cp_add_using_directive (const char *dest, const char *alias, const char *declaration, VEC (const_char_ptr) *excludes, + int copy_names, struct obstack *obstack); -extern void cp_set_block_scope (const struct symbol *symbol, - struct block *block, - struct obstack *obstack, - const char *processing_current_prefix, - int processing_has_namespace_info); - extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol, struct objfile *objfile); diff --git a/gdb/dbxread.c b/gdb/dbxread.c index fcd4d82..09b46a0 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -55,6 +55,7 @@ #include "cp-abi.h" #include "cp-support.h" #include "psympriv.h" +#include "block.h" #include "gdb_assert.h" #include "gdb_string.h" @@ -2706,6 +2707,34 @@ read_ofile_symtab (struct objfile *objfile, struct partial_symtab *pst) } +/* Record the namespace that the function defined by SYMBOL was + defined in, if necessary. BLOCK is the associated block; use + OBSTACK for allocation. */ + +static void +cp_set_block_scope (const struct symbol *symbol, + struct block *block, + struct obstack *obstack) +{ + if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) + { + /* Try to figure out the appropriate namespace from the + demangled name. */ + + /* FIXME: carlton/2003-04-15: If the function in question is + a method of a class, the name will actually include the + name of the class as well. This should be harmless, but + is a little unfortunate. */ + + const char *name = SYMBOL_DEMANGLED_NAME (symbol); + unsigned int prefix_len = cp_entire_prefix_len (name); + + block_set_scope (block, + obstack_copy0 (obstack, name, prefix_len), + obstack); + } +} + /* This handles a single symbol from the symbol-file, building symbols into a GDB symtab. It takes these arguments and an implicit argument. @@ -2813,8 +2842,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, /* For C++, set the block's scope. */ if (SYMBOL_LANGUAGE (new->name) == language_cplus) - cp_set_block_scope (new->name, block, &objfile->objfile_obstack, - "", 0); + cp_set_block_scope (new->name, block, &objfile->objfile_obstack); /* May be switching to an assembler file which may not be using block relative stabs, so reset the offset. */ @@ -3219,8 +3247,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, /* For C++, set the block's scope. */ if (SYMBOL_LANGUAGE (new->name) == language_cplus) cp_set_block_scope (new->name, block, - &objfile->objfile_obstack, - "", 0); + &objfile->objfile_obstack); } new = push_context (0, valu); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 1957f9d..6d8276b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -90,12 +90,6 @@ static int check_physname = 0; /* When non-zero, do not reject deprecated .gdb_index sections. */ static int use_deprecated_index_sections = 0; -/* When set, the file that we're processing is known to have debugging - info for C++ namespaces. GCC 3.3.x did not produce this information, - but later versions do. */ - -static int processing_has_namespace_info; - static const struct objfile_data *dwarf2_objfile_data_key; struct dwarf2_section_info @@ -509,6 +503,12 @@ struct dwarf2_cu unsigned int producer_is_gxx_lt_4_6 : 1; unsigned int producer_is_gcc_lt_4_3 : 1; unsigned int producer_is_icc : 1; + + /* When set, the file that we're processing is known to have + debugging info for C++ namespaces. GCC 3.3.x did not produce + this information, but later versions do. */ + + unsigned int processing_has_namespace_info : 1; }; /* Persistent data held for a compilation unit, even when not @@ -3547,6 +3547,8 @@ dw2_expand_symtabs_matching break; } + /* BASENAMES_MAY_DIFFER optimization cannot be applied here + as DATA basename cannot be extracted. */ this_real_name = dw2_get_real_path (objfile, file_data, j); if (file_matcher (this_real_name, data)) { @@ -7235,16 +7237,16 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_common_inclusion: break; case DW_TAG_namespace: - processing_has_namespace_info = 1; + cu->processing_has_namespace_info = 1; read_namespace (die, cu); break; case DW_TAG_module: - processing_has_namespace_info = 1; + cu->processing_has_namespace_info = 1; read_module (die, cu); break; case DW_TAG_imported_declaration: case DW_TAG_imported_module: - processing_has_namespace_info = 1; + cu->processing_has_namespace_info = 1; if (die->child != NULL && (die->tag == DW_TAG_imported_declaration || cu->language != language_fortran)) complaint (&symfile_complaints, _("Tag '%s' has unexpected children"), @@ -7719,8 +7721,6 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) VEC (const_char_ptr) *excludes = NULL; struct cleanup *cleanups; - char *temp; - import_attr = dwarf2_attr (die, DW_AT_import, cu); if (import_attr == NULL) { @@ -7786,14 +7786,9 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) canonical_name = imported_name_prefix; } else if (strlen (imported_name_prefix) > 0) - { - temp = alloca (strlen (imported_name_prefix) - + 2 + strlen (imported_name) + 1); - strcpy (temp, imported_name_prefix); - strcat (temp, "::"); - strcat (temp, imported_name); - canonical_name = temp; - } + canonical_name = obconcat (&objfile->objfile_obstack, + imported_name_prefix, "::", imported_name, + (char *) NULL); else canonical_name = imported_name; @@ -7848,6 +7843,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) import_alias, imported_declaration, excludes, + 0, &objfile->objfile_obstack); do_cleanups (cleanups); @@ -9576,10 +9572,10 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) lowpc, highpc, objfile); /* For C++, set the block's scope. */ - if (cu->language == language_cplus || cu->language == language_fortran) - cp_set_block_scope (new->name, block, &objfile->objfile_obstack, - determine_prefix (die, cu), - processing_has_namespace_info); + if ((cu->language == language_cplus || cu->language == language_fortran) + && cu->processing_has_namespace_info) + block_set_scope (block, determine_prefix (die, cu), + &objfile->objfile_obstack); /* If we have address ranges, record them. */ dwarf2_record_block_ranges (die, block, baseaddr, cu); @@ -12114,7 +12110,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) const char *previous_prefix = determine_prefix (die, cu); cp_add_using_directive (previous_prefix, TYPE_NAME (type), NULL, - NULL, NULL, &objfile->objfile_obstack); + NULL, NULL, 0, &objfile->objfile_obstack); } } @@ -15677,7 +15673,7 @@ dwarf2_start_symtab (struct dwarf2_cu *cu, /* We assume that we're processing GCC output. */ processing_gcc_compilation = 2; - processing_has_namespace_info = 0; + cu->processing_has_namespace_info = 0; } static void @@ -16122,7 +16118,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, /* For the benefit of old versions of GCC, check for anonymous namespaces based on the demangled name. */ - if (!processing_has_namespace_info + if (!cu->processing_has_namespace_info && cu->language == language_cplus) cp_scan_for_anonymous_namespaces (sym, objfile); } diff --git a/gdb/macroscope.c b/gdb/macroscope.c index 81242ed..fba343d 100644 --- a/gdb/macroscope.c +++ b/gdb/macroscope.c @@ -26,7 +26,6 @@ #include "frame.h" #include "inferior.h" #include "complaints.h" -#include "filenames.h" /* A table of user-defined macros. Unlike the macro tables used for symtabs, this one uses xmalloc for all its allocation, not an diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 01e02c8..819a832 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -683,6 +683,58 @@ vector_relop (struct expression *exp, struct value *val1, struct value *val2, return ret; } +/* Perform a cast of ARG into TYPE. There's sadly a lot of duplication in + here from valops.c:value_cast, opencl is different only in the + behaviour of scalar to vector casting. As far as possibly we're going + to try and delegate back to the standard value_cast function. */ + +static struct value * +opencl_value_cast (struct type *type, struct value *arg) +{ + if (type != value_type (arg)) + { + /* Casting scalar to vector is a special case for OpenCL, scalar + is cast to element type of vector then replicated into each + element of the vector. First though, we need to work out if + this is a scalar to vector cast; code lifted from + valops.c:value_cast. */ + enum type_code code1, code2; + struct type *to_type; + int scalar; + + to_type = check_typedef (type); + + code1 = TYPE_CODE (to_type); + code2 = TYPE_CODE (check_typedef (value_type (arg))); + + if (code2 == TYPE_CODE_REF) + code2 = TYPE_CODE (check_typedef (value_type (coerce_ref (arg)))); + + scalar = (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL hooks/post-receive -- Repository for Project Archer.