public inbox for src-cvs@sourceware.org help / color / mirror / Atom feed
From: brobecke@sourceware.org To: src-cvs@sourceware.org Subject: gdb and binutils branch master updated. 2df4d1d5c4393fd06c2bffe75499e70a8d8ac8a8 Date: Mon, 11 Nov 2013 15:19:00 -0000 [thread overview] Message-ID: <20131111151939.3547.qmail@sourceware.org> (raw) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via 2df4d1d5c4393fd06c2bffe75499e70a8d8ac8a8 (commit) from 99c1d4518bf2ff230eaa6ee54c08e85f2d6c008e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2df4d1d5c4393fd06c2bffe75499e70a8d8ac8a8 commit 2df4d1d5c4393fd06c2bffe75499e70a8d8ac8a8 Author: Joel Brobecker <brobecker@adacore.com> Date: Wed Oct 30 11:18:24 2013 +0100 Dandling memory pointers in Ada catchpoints with GDB/MI. When using the GDB/MI commands to insert a catchpoint on a specific Ada exception, any re-evaluation of that catchpoint (for instance a re-evaluation performed after a shared library got mapped by the inferior) fails. For instance, with any Ada program: (gdb) -catch-exception -e program_error ^done,bkptno="1",bkpt={[...]} (gdb) -exec-run =thread-group-started,id="i1",pid="28315" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" (gdb) =library-loaded,[...] &"warning: failed to reevaluate internal exception condition for catchpoint 1: No definition of \"exec\" in current context.\n" &"warning: failed to reevaluate internal exception condition for catchpoint 1: No definition of \"exec\" in current context.\n" [...] The same is true if using an Ada exception catchpoint. The problem comes from the fact that that we deallocate the strings given as arguments to create_ada_exception_catchpoint, while the latter just makes shallow copies of those strings, thus creating dandling pointers. This patch fixes the issue by passing freshly allocated strings to create_ada_exception_catchpoint, while at the same time updating create_ada_exception_catchpoint's documentation to make it clear that deallocating the strings is no longer the responsibility of the caller. gdb/ChangeLog: * ada-lang.c (create_ada_exception_catchpoint): Enhance the documentation of fields "except_string" and "condition". * mi/mi-cmd-catch.c (mi_cmd_catch_assert): Reallocate CONDITION on the heap before passing it to create_ada_exception_catchpoint. (mi_cmd_catch_exception): Likewise for EXCEPTION_NAME and CONDITION. gdb/testsuite/ChangeLog: * gdb.ada/mi_ex_cond: New testcase. Tested on x86_64-linux. The "-break-list" test FAILs without this patch. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 10 +++ gdb/ada-lang.c | 14 +++-- gdb/mi/mi-cmd-catch.c | 10 +++ gdb/testsuite/ChangeLog | 4 + gdb/testsuite/gdb.ada/mi_ex_cond.exp | 94 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.ada/mi_ex_cond/foo.adb | 29 +++++++++ gdb/testsuite/gdb.ada/mi_ex_cond/pck.ads | 18 ++++++ 7 files changed, 174 insertions(+), 5 deletions(-) create mode 100644 gdb/testsuite/gdb.ada/mi_ex_cond.exp create mode 100644 gdb/testsuite/gdb.ada/mi_ex_cond/foo.adb create mode 100644 gdb/testsuite/gdb.ada/mi_ex_cond/pck.ads hooks/post-receive -- gdb and binutils
reply other threads:[~2013-11-11 15:19 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20131111151939.3547.qmail@sourceware.org \ --to=brobecke@sourceware.org \ --cc=src-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).