Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jcejka:branches:SUSE:SLE-15-SP2:Update
gdb
0001-gdb-Add-aliases-for-read_core_file_mapping...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-gdb-Add-aliases-for-read_core_file_mappings-callback.patch of Package gdb
From aa95b2d43883666937d31335d0178d2218d9c9aa Mon Sep 17 00:00:00 2001 From: Aaron Merey <amerey@redhat.com> Date: Tue, 9 Nov 2021 16:47:36 -0500 Subject: [PATCH] gdb: Add aliases for read_core_file_mappings callbacks Add aliases read_core_file_mappings_loop_ftype and read_core_file_mappings_pre_loop_ftype. Intended for use with read_core_file_mappings. Also add build_id parameter to read_core_file_mappings_loop_ftype. --- gdb/arch-utils.c | 15 +++++---------- gdb/arch-utils.h | 15 +++++---------- gdb/corelow.c | 2 +- gdb/gdbarch.c | 2 +- gdb/gdbarch.h | 16 ++++++++++++++-- gdb/gdbarch.sh | 14 +++++++++++++- gdb/linux-tdep.c | 19 +++++++------------ 7 files changed, 46 insertions(+), 37 deletions(-) Index: gdb-11.1/gdb/arch-utils.c =================================================================== --- gdb-11.1.orig/gdb/arch-utils.c +++ gdb-11.1/gdb/arch-utils.c @@ -1072,16 +1072,11 @@ default_get_pc_address_flags (frame_info /* See arch-utils.h. */ void -default_read_core_file_mappings (struct gdbarch *gdbarch, - struct bfd *cbfd, - gdb::function_view<void (ULONGEST count)> - pre_loop_cb, - gdb::function_view<void (int num, - ULONGEST start, - ULONGEST end, - ULONGEST file_ofs, - const char *filename)> - loop_cb) +default_read_core_file_mappings + (struct gdbarch *gdbarch, + struct bfd *cbfd, + read_core_file_mappings_pre_loop_ftype pre_loop_cb, + read_core_file_mappings_loop_ftype loop_cb) { } Index: gdb-11.1/gdb/arch-utils.h =================================================================== --- gdb-11.1.orig/gdb/arch-utils.h +++ gdb-11.1/gdb/arch-utils.h @@ -295,14 +295,9 @@ extern std::string default_get_pc_addres CORE_ADDR pc); /* Default implementation of gdbarch read_core_file_mappings method. */ -extern void default_read_core_file_mappings (struct gdbarch *gdbarch, - struct bfd *cbfd, - gdb::function_view<void (ULONGEST count)> - pre_loop_cb, - gdb::function_view<void (int num, - ULONGEST start, - ULONGEST end, - ULONGEST file_ofs, - const char *filename)> - loop_cb); +extern void default_read_core_file_mappings + (struct gdbarch *gdbarch, + struct bfd *cbfd, + read_core_file_mappings_pre_loop_ftype pre_loop_cb, + read_core_file_mappings_loop_ftype loop_cb); #endif /* ARCH_UTILS_H */ Index: gdb-11.1/gdb/corelow.c =================================================================== --- gdb-11.1.orig/gdb/corelow.c +++ gdb-11.1/gdb/corelow.c @@ -218,7 +218,7 @@ core_target::build_file_mappings () /* read_core_file_mappings will invoke this lambda for each mapping that it finds. */ [&] (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, - const char *filename) + const char *filename, const bfd_build_id *build_id) { /* Architecture-specific read_core_mapping methods are expected to weed out non-file-backed mappings. */ Index: gdb-11.1/gdb/gdbarch.c =================================================================== --- gdb-11.1.orig/gdb/gdbarch.c +++ gdb-11.1/gdb/gdbarch.c @@ -5411,7 +5411,7 @@ set_gdbarch_get_pc_address_flags (struct } void -gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd, gdb::function_view<void (ULONGEST count)> pre_loop_cb, gdb::function_view<void (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, const char *filename)> loop_cb) +gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->read_core_file_mappings != NULL); Index: gdb-11.1/gdb/gdbarch.h =================================================================== --- gdb-11.1.orig/gdb/gdbarch.h +++ gdb-11.1/gdb/gdbarch.h @@ -129,6 +129,18 @@ enum class memtag_type allocation, }; +/* Callback types for 'read_core_file_mappings' gdbarch method. */ + +using read_core_file_mappings_pre_loop_ftype = + gdb::function_view<void (ULONGEST count)>; + +using read_core_file_mappings_loop_ftype = + gdb::function_view<void (int num, + ULONGEST start, + ULONGEST end, + ULONGEST file_ofs, + const char *filename, + const bfd_build_id *build_id)>; /* The following are pre-initialized by GDBARCH. */ @@ -1710,8 +1722,8 @@ extern void set_gdbarch_get_pc_address_f /* Read core file mappings */ -typedef void (gdbarch_read_core_file_mappings_ftype) (struct gdbarch *gdbarch, struct bfd *cbfd, gdb::function_view<void (ULONGEST count)> pre_loop_cb, gdb::function_view<void (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, const char *filename)> loop_cb); -extern void gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd, gdb::function_view<void (ULONGEST count)> pre_loop_cb, gdb::function_view<void (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, const char *filename)> loop_cb); +typedef void (gdbarch_read_core_file_mappings_ftype) (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb); +extern void gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb); extern void set_gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, gdbarch_read_core_file_mappings_ftype *read_core_file_mappings); extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); Index: gdb-11.1/gdb/gdbarch.sh =================================================================== --- gdb-11.1.orig/gdb/gdbarch.sh +++ gdb-11.1/gdb/gdbarch.sh @@ -1210,7 +1210,7 @@ m;ULONGEST;type_align;struct type *type; f;std::string;get_pc_address_flags;frame_info *frame, CORE_ADDR pc;frame, pc;;default_get_pc_address_flags;;0 # Read core file mappings -m;void;read_core_file_mappings;struct bfd *cbfd, gdb::function_view<void (ULONGEST count)> pre_loop_cb, gdb::function_view<void (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, const char *filename)> loop_cb;cbfd, pre_loop_cb, loop_cb;;default_read_core_file_mappings;;0 +m;void;read_core_file_mappings;struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb;cbfd, pre_loop_cb, loop_cb;;default_read_core_file_mappings;;0 EOF } @@ -1400,6 +1400,18 @@ enum class memtag_type allocation, }; +/* Callback types for 'read_core_file_mappings' gdbarch method. */ + +using read_core_file_mappings_pre_loop_ftype = + gdb::function_view<void (ULONGEST count)>; + +using read_core_file_mappings_loop_ftype = + gdb::function_view<void (int num, + ULONGEST start, + ULONGEST end, + ULONGEST file_ofs, + const char *filename, + const bfd_build_id *build_id)>; EOF # function typedef's Index: gdb-11.1/gdb/linux-tdep.c =================================================================== --- gdb-11.1.orig/gdb/linux-tdep.c +++ gdb-11.1/gdb/linux-tdep.c @@ -1096,16 +1096,11 @@ linux_info_proc (struct gdbarch *gdbarch for each mapping. */ static void -linux_read_core_file_mappings (struct gdbarch *gdbarch, - struct bfd *cbfd, - gdb::function_view<void (ULONGEST count)> - pre_loop_cb, - gdb::function_view<void (int num, - ULONGEST start, - ULONGEST end, - ULONGEST file_ofs, - const char *filename)> - loop_cb) +linux_read_core_file_mappings + (struct gdbarch *gdbarch, + struct bfd *cbfd, + read_core_file_mappings_pre_loop_ftype pre_loop_cb, + read_core_file_mappings_loop_ftype loop_cb) { /* Ensure that ULONGEST is big enough for reading 64-bit core files. */ gdb_static_assert (sizeof (ULONGEST) >= 8); @@ -1188,7 +1183,7 @@ linux_read_core_file_mappings (struct gd char * filename = filenames; filenames += strlen ((char *) filenames) + 1; - loop_cb (i, start, end, file_ofs, filename); + loop_cb (i, start, end, file_ofs, filename, nullptr); } } @@ -1217,7 +1212,7 @@ linux_core_info_proc_mappings (struct gd } }, [=] (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, - const char *filename) + const char *filename, const bfd_build_id *build_id) { if (gdbarch_addr_bit (gdbarch) == 32) printf_filtered ("\t%10s %10s %10s %10s %s\n",
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor