public inbox for gdb-testers@sourceware.org help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Subject: [binutils-gdb] Back out earlier Ada exception change Date: Fri, 04 Oct 2019 11:04:00 -0000 [thread overview] Message-ID: <fccf9de11fe6757afd3ad2dca4e0ea781b50ae37@gdb-build> (raw) *** TEST RESULTS FOR COMMIT fccf9de11fe6757afd3ad2dca4e0ea781b50ae37 *** commit fccf9de11fe6757afd3ad2dca4e0ea781b50ae37 Author: Tom Tromey <tromey@adacore.com> AuthorDate: Fri Jun 14 07:45:01 2019 -0600 Commit: Tom Tromey <tromey@adacore.com> CommitDate: Wed Oct 2 09:53:17 2019 -0600 Back out earlier Ada exception change commit 2ff0a9473 (Fix "catch exception" with dynamic linking) changed how ada-lang.c creates expressions to determine if an exception catchpoint should stop. That patch is no longer needed now that copy relocations are handled more directly. gdb/ChangeLog 2019-10-02 Tom Tromey <tromey@adacore.com> * ada-lang.c (ada_lookup_simple_minsyms): Remove. (create_excep_cond_exprs): Simplify exception string computation. (ada_exception_catchpoint_cond_string): Likewise. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9bfb7551df..7cea3f51f4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-10-02 Tom Tromey <tromey@adacore.com> + + * ada-lang.c (ada_lookup_simple_minsyms): Remove. + (create_excep_cond_exprs): Simplify exception string computation. + (ada_exception_catchpoint_cond_string): Likewise. + 2019-10-02 Tom Tromey <tromey@adacore.com> * symmisc.c (dump_msymbols): Don't use MSYMBOL_VALUE_ADDRESS. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index f7f972a9bc..6e2746fe56 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -4836,36 +4836,6 @@ ada_lookup_simple_minsym (const char *name) return result; } -/* Return all the bound minimal symbols matching NAME according to Ada - decoding rules. Returns an empty vector if there is no such - minimal symbol. Names prefixed with "standard__" are handled - specially: "standard__" is first stripped off, and only static and - global symbols are searched. */ - -static std::vector<struct bound_minimal_symbol> -ada_lookup_simple_minsyms (const char *name) -{ - std::vector<struct bound_minimal_symbol> result; - - symbol_name_match_type match_type = name_match_type_from_name (name); - lookup_name_info lookup_name (name, match_type); - - symbol_name_matcher_ftype *match_name - = ada_get_symbol_name_matcher (lookup_name); - - for (objfile *objfile : current_program_space->objfiles ()) - { - for (minimal_symbol *msymbol : objfile->msymbols ()) - { - if (match_name (MSYMBOL_LINKAGE_NAME (msymbol), lookup_name, NULL) - && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline) - result.push_back ({msymbol, objfile}); - } - } - - return result; -} - /* For all subprograms that statically enclose the subprogram of the selected frame, add symbols matching identifier NAME in DOMAIN and their blocks to the list of data in OBSTACKP, as for @@ -12355,6 +12325,8 @@ static void create_excep_cond_exprs (struct ada_catchpoint *c, enum ada_exception_catchpoint_kind ex) { + struct bp_location *bl; + /* Nothing to do if there's no specific exception to catch. */ if (c->excep_string.empty ()) return; @@ -12363,45 +12335,28 @@ create_excep_cond_exprs (struct ada_catchpoint *c, if (c->loc == NULL) return; - /* We have to compute the expression once for each program space, - because the expression may hold the addresses of multiple symbols - in some cases. */ - std::multimap<program_space *, struct bp_location *> loc_map; - for (bp_location *bl = c->loc; bl != NULL; bl = bl->next) - loc_map.emplace (bl->pspace, bl); - - scoped_restore_current_program_space save_pspace; + /* Compute the condition expression in text form, from the specific + expection we want to catch. */ + std::string cond_string + = ada_exception_catchpoint_cond_string (c->excep_string.c_str (), ex); - std::string cond_string; - program_space *last_ps = nullptr; - for (auto iter : loc_map) + /* Iterate over all the catchpoint's locations, and parse an + expression for each. */ + for (bl = c->loc; bl != NULL; bl = bl->next) { struct ada_catchpoint_location *ada_loc - = (struct ada_catchpoint_location *) iter.second; - - if (ada_loc->pspace != last_ps) - { - last_ps = ada_loc->pspace; - set_current_program_space (last_ps); - - /* Compute the condition expression in text form, from the - specific expection we want to catch. */ - cond_string - = ada_exception_catchpoint_cond_string (c->excep_string.c_str (), - ex); - } - + = (struct ada_catchpoint_location *) bl; expression_up exp; - if (!ada_loc->shlib_disabled) + if (!bl->shlib_disabled) { const char *s; s = cond_string.c_str (); try { - exp = parse_exp_1 (&s, ada_loc->address, - block_for_pc (ada_loc->address), + exp = parse_exp_1 (&s, bl->address, + block_for_pc (bl->address), 0); } catch (const gdb_exception_error &e) @@ -13071,18 +13026,18 @@ ada_exception_catchpoint_cond_string (const char *excep_string, enum ada_exception_catchpoint_kind ex) { int i; + bool is_standard_exc = false; std::string result; - const char *name; if (ex == ada_catch_handlers) { /* For exception handlers catchpoints, the condition string does not use the same parameter as for the other exceptions. */ - name = ("long_integer (GNAT_GCC_exception_Access" - "(gcc_exception).all.occurrence.id)"); + result = ("long_integer (GNAT_GCC_exception_Access" + "(gcc_exception).all.occurrence.id)"); } else - name = "long_integer (e)"; + result = "long_integer (e)"; /* The standard exceptions are a special case. They are defined in runtime units that have been compiled without debugging info; if @@ -13101,35 +13056,23 @@ ada_exception_catchpoint_cond_string (const char *excep_string, If an exception named contraint_error is defined in another package of the inferior program, then the only way to specify this exception as a breakpoint condition is to use its fully-qualified named: - e.g. my_package.constraint_error. - - Furthermore, in some situations a standard exception's symbol may - be present in more than one objfile, because the compiler may - choose to emit copy relocations for them. So, we have to compare - against all the possible addresses. */ + e.g. my_package.constraint_error. */ - /* Storage for a rewritten symbol name. */ - std::string std_name; for (i = 0; i < sizeof (standard_exc) / sizeof (char *); i++) { if (strcmp (standard_exc [i], excep_string) == 0) { - std_name = std::string ("standard.") + excep_string; - excep_string = std_name.c_str (); + is_standard_exc = true; break; } } - excep_string = ada_encode (excep_string); - std::vector<struct bound_minimal_symbol> symbols - = ada_lookup_simple_minsyms (excep_string); - for (const bound_minimal_symbol &msym : symbols) - { - if (!result.empty ()) - result += " or "; - string_appendf (result, "%s = %s", name, - pulongest (BMSYMBOL_VALUE_ADDRESS (msym))); - } + result += " = "; + + if (is_standard_exc) + string_appendf (result, "long_integer (&standard.%s)", excep_string); + else + string_appendf (result, "long_integer (&%s)", excep_string); return result; }
next reply other threads:[~2019-10-04 11:04 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-04 11:04 gdb-buildbot [this message] 2019-10-04 11:04 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot 2019-10-04 13:24 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot 2019-10-07 8:35 ` Failures on Fedora-i686, " gdb-buildbot 2019-10-07 9:20 ` Failures on Fedora-x86_64-m64, " gdb-buildbot 2019-10-07 10:15 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot 2019-10-07 10:23 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot 2019-10-07 11:03 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
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=fccf9de11fe6757afd3ad2dca4e0ea781b50ae37@gdb-build \ --to=gdb-buildbot@sergiodj.net \ --cc=gdb-testers@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).