summaryrefslogtreecommitdiff
path: root/gdb/gcore.h
AgeCommit message (Collapse)Author
2018-01-02Update copyright year range in all GDB filesJoel Brobecker
gdb/ChangeLog: Update copyright year range in all GDB files
2017-01-10Use class to manage BFD reference countsTom Tromey
This introduces a new specialization of gdb::ref_ptr that can be used to manage BFD reference counts. Then it changes most places in gdb to use this new class, rather than explicit reference-counting or cleanups. This patch removes make_cleanup_bfd_unref. If you look you will see a couple of spots using "release" where a use of gdb_bfd_ref_ptr would be cleaner. These will be fixed in the next patch. I think this patch fixes some latent bugs. For example, it seems to me that previously objfpy_add_separate_debug_file leaked a BFD. I'm not 100% certain that the macho_symfile_read_all_oso change is correct. The existing code here is hard for me to follow. One goal of this sort of automated reference counting, though, is to make it more difficult to make logic errors; so hopefully the code is clear now. 2017-01-10 Tom Tromey <tom@tromey.com> * windows-tdep.c (windows_xfer_shared_library): Update. * windows-nat.c (windows_make_so): Update. * utils.h (make_cleanup_bfd_unref): Remove. * utils.c (do_bfd_close_cleanup, make_cleanup_bfd_unref): Remove. * symfile.h (symfile_bfd_open) (find_separate_debug_file_in_section): Return gdb_bfd_ref_ptr. * symfile.c (read_symbols, symbol_file_add) (separate_debug_file_exists): Update. (symfile_bfd_open): Return gdb_bfd_ref_ptr. (generic_load, reread_symbols): Update. * symfile-mem.c (symbol_file_add_from_memory): Update. * spu-linux-nat.c (spu_bfd_open): Return gdb_bfd_ref_ptr. (spu_symbol_file_add_from_memory): Update. * solist.h (struct target_so_ops) <bfd_open>: Return gdb_bfd_ref_ptr. (solib_bfd_fopen, solib_bfd_open): Return gdb_bfd_ref_ptr. * solib.c (solib_bfd_fopen, solib_bfd_open): Return gdb_bfd_ref_ptr. (solib_map_sections, reload_shared_libraries_1): Update. * solib-svr4.c (enable_break): Update. * solib-spu.c (spu_bfd_fopen): Return gdb_bfd_ref_ptr. * solib-frv.c (enable_break2): Update. * solib-dsbt.c (enable_break): Update. * solib-darwin.c (gdb_bfd_mach_o_fat_extract): Return gdb_bfd_ref_ptr. (darwin_solib_get_all_image_info_addr_at_init): Update. (darwin_bfd_open): Return gdb_bfd_ref_ptr. * solib-aix.c (solib_aix_bfd_open): Return gdb_bfd_ref_ptr. * record-full.c (record_full_save): Update. * python/py-objfile.c (objfpy_add_separate_debug_file): Update. * procfs.c (insert_dbx_link_bpt_in_file): Update. * minidebug.c (find_separate_debug_file_in_section): Return gdb_bfd_ref_ptr. * machoread.c (macho_add_oso_symfile): Change abfd to gdb_bfd_ref_ptr. (macho_symfile_read_all_oso): Update. (macho_check_dsym): Return gdb_bfd_ref_ptr. (macho_symfile_read): Update. * jit.c (bfd_open_from_target_memory): Return gdb_bfd_ref_ptr. (jit_bfd_try_read_symtab): Update. * gdb_bfd.h (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr) (gdb_bfd_openw, gdb_bfd_openr_iovec) (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return gdb_bfd_ref_ptr. (gdb_bfd_ref_policy): New struct. (gdb_bfd_ref_ptr): New typedef. * gdb_bfd.c (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr) (gdb_bfd_openw, gdb_bfd_openr_iovec) (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return gdb_bfd_ref_ptr. * gcore.h (create_gcore_bfd): Return gdb_bfd_ref_ptr. * gcore.c (create_gcore_bfd): Return gdb_bfd_ref_ptr. (gcore_command): Update. * exec.c (exec_file_attach): Update. * elfread.c (elf_symfile_read): Update. * dwarf2read.c (dwarf2_get_dwz_file): Update. (try_open_dwop_file, open_dwo_file): Return gdb_bfd_ref_ptr. (open_and_init_dwo_file): Update. (open_dwp_file): Return gdb_bfd_ref_ptr. (open_and_init_dwp_file): Update. * corelow.c (core_open): Update. * compile/compile-object-load.c (compile_object_load): Update. * common/gdb_ref_ptr.h (ref_ptr::operator->): New operator. * coffread.c (coff_symfile_read): Update. * cli/cli-dump.c (bfd_openr_or_error, bfd_openw_or_error): Return gdb_bfd_ref_ptr. Rename. (dump_bfd_file, restore_command): Update. * build-id.h (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr. * build-id.c (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr. (find_separate_debug_file_by_buildid): Update.
2017-01-01update copyright year range in GDB filesJoel Brobecker
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-02-19remove exec_set_find_memory_regionsTom Tromey
exec_set_find_memory_regions is used to modify the exec target. However, it only has a single caller, and so it is much clearer to simply set the appropriate field directly. It's also better for the coming multi-target world to avoid this kind of global state change anyway. 2014-02-19 Tom Tromey <tromey@redhat.com> * gcore.h (objfile_find_memory_regions): Declare. * gcore.c (objfile_find_memory_regions): No longer static. Add "self" argument. (_initialize_gcore): Don't call exec_set_find_memory_regions. * exec.c: Include gcore.h. (exec_set_find_memory_regions): Remove. (exec_find_memory_regions): Remove. (exec_do_find_memory_regions): Remove. (init_exec_ops): Update. * defs.h (exec_set_find_memory_regions): Remove.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker
2013-05-14 * gcore.c (create_gcore_bfd): Make 'filename' const.Tom Tromey
* gcore.h (create_gcore_bfd): Make 'filename' const. * record-full.c (record_full_save): Make 'recfilename' const. * target.c (target_save_record): Make 'filename' const. * target.h (struct target_ops) <to_save_record>: Make 'filename' const. (target_save_record): Likewise.
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2012-01-02Update the copyright header of various files...Joel Brobecker
... to follow the correct syntax (according to the gospel of gnulib's update-copyright). In other words: - no comma after the last year; - FSF spelled exactly "Free Software Foundation, Inc.", with the comma and the period at the end. sim/common/ChangeLog: * dv-sockser.h, sim-assert.h, sim-fpu.c: Reformat the copyright header. sim/m32c/ChangeLog: * blinky.S, gloss.S, sample.S: Reformat copyright header. sim/mn10300/ChangeLog: * sim-main.h: Reformat copyright header. sim/ppc/ChangeLog: * dp-bit.c: Reformat copyright header. gdb/ChangeLog: * gdb/common/gdb_thread_db.h, gdb/dbxread.c, gdb/environ.c, gdb/gcore.h, gdb/rs6000-tdep.h, gdb/s390-nat.c, gdb/tic6x-tdep.c: Reformat the copyright header. gdb/gdbserver/ChangeLog: * terminal.h: Reformat copyright header. gdb/testsuite/ChangeLog: * dg-extract-results.sh, gdb.arch/gcore.c, gdb.arch/gdb1558.c, gdb.arch/i386-gnu-cfi.c, gdb.base/complex.c, gdb.base/cvexpr.c, gdb.base/gcore.c, gdb.base/gdb1555-main.c, gdb.base/gdb1555.c, gdb.base/gdb1821.c, gdb.base/long_long.c, gdb.base/restore.c, gdb.base/sepdebug.c, gdb.base/type-opaque-lib.c, gdb.base/type-opaque-main.c, gdb.cp/maint.exp, gdb.cp/namespace1.cc, gdb.cp/pr9631.cc, gdb.cp/psmang1.cc, gdb.cp/psmang2.cc, gdb.cp/try_catch.cc, gdb.cp/virtfunc.cc, gdb.hp/gdb.base-hp/reg.exp, gdb.mi/basics.c, gdb.mi/mi-stack.c, gdb.mi/mi-var-child.c, gdb.mi/mi2-var-child.exp, gdb.mi/var-cmd.c, gdb.threads/thread_check.c: Reformat copyright header.
2009-10-222009-10-16 Hui Zhu <teawater@gmail.com>Michael Snyder
Michael Snyder <msnyder@msnyder-server.eng.vmware.com> * record.c (RECORD_FILE_MAGIC): New constant. (record_arch_list_cleanups): Renamed from record_message_cleanups. (bfdcore_read): New function. (netorder64): New function. (netorder32): New function. (netorder16): New function. (record_restore): New function. Restore a saved record log. (bfdcore_write): New function. (cmd_record_restore): New function. (cmd_record_save): New function. Save a record log to a file. (_initialize_record): Set up commands for save and restore. 2009-10-17 Michael Snyder <msnyder@vmware.com> * gcore.h: New file. * gcore.c (create_gcore_bfd): New function. (write_gcore_file): New function. (call_target_sbrk): New function. Abstracted from gcore_command. (gcore_command): Call call_target_sbrk.