aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-10-29 12:55:01 +0000
committerPedro Alves <palves@redhat.com>2015-10-29 12:55:01 +0000
commit9c6595ab6873e15fe533b05bb7b98c11f17c5d57 (patch)
treed143151526b9e32b0915c8004d81830e167bc319 /gdb/solib.c
parentf82aa1657b7254ab634bfcce7354770478c31686 (diff)
downloadgdb-9c6595ab6873e15fe533b05bb7b98c11f17c5d57.zip
gdb-9c6595ab6873e15fe533b05bb7b98c11f17c5d57.tar.gz
gdb-9c6595ab6873e15fe533b05bb7b98c11f17c5d57.tar.bz2
Don't assume break/continue inside a TRY block works
In C++, this: try { break; } catch (..) {} is invalid. However, because our TRY/CATCH macros support it in C, the C++ version of those macros support it too. To catch such assumptions, this adds a (disabled) hack that maps TRY/CATCH to raw C++ try/catch. Then it goes through all instances that building on x86_64 GNU/Linux trips on, fixing them. This isn't strictly necessary yet, but I think it's nicer to try to keep the tree in a state where it's easier to eliminate the TRY/CATCH macros. gdb/ChangeLog: 2015-10-29 Pedro Alves <palves@redhat.com> * dwarf2-frame-tailcall.c (dwarf2_tailcall_sniffer_first): Don't assume that "break" breaks out of a TRY/CATCH. * python/py-framefilter.c (py_print_single_arg): Don't assume "continue" breaks out of a TRY/CATCH. * python/py-value.c (valpy_binop_throw): New function, factored out from ... (valpy_binop): ... this. (valpy_richcompare_throw): New function, factored out from ... (valpy_richcompare): ... this. * solib.c (solib_read_symbols): Don't assume "break" breaks out of a TRY/CATCH. * common/common-exceptions.h [USE_RAW_CXX_TRY] <TRY/CATCH/END_CATCH>: Define as 1-1 wrappers around try/catch.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index ca2c9ab..d715897 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -696,16 +696,16 @@ solib_read_symbols (struct so_list *so, int flags)
&& so->objfile->addr_low == so->addr_low)
break;
}
- if (so->objfile != NULL)
- break;
-
- sap = build_section_addr_info_from_section_table (so->sections,
- so->sections_end);
- so->objfile = symbol_file_add_from_bfd (so->abfd, so->so_name,
- flags, sap, OBJF_SHARED,
- NULL);
- so->objfile->addr_low = so->addr_low;
- free_section_addr_info (sap);
+ if (so->objfile == NULL)
+ {
+ sap = build_section_addr_info_from_section_table (so->sections,
+ so->sections_end);
+ so->objfile = symbol_file_add_from_bfd (so->abfd, so->so_name,
+ flags, sap, OBJF_SHARED,
+ NULL);
+ so->objfile->addr_low = so->addr_low;
+ free_section_addr_info (sap);
+ }
so->symbols_loaded = 1;
}