From c3ff6461e5ec924629e77c704bf683485ffa6242 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 10 Jan 2025 21:34:30 -0500 Subject: [PATCH] Debug Kit: Don't rebuild image_info for LoadedImage. The one that came from the kernel will be more accurate, including having text and data sizes that properly encompass all regions. Change-Id: I63bea39727fad7d87323568f3904a8f7ed992264 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8824 Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/kits/debug/SymbolLookup.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/kits/debug/SymbolLookup.cpp b/src/kits/debug/SymbolLookup.cpp index 9205aa813b..0ad999f181 100644 --- a/src/kits/debug/SymbolLookup.cpp +++ b/src/kits/debug/SymbolLookup.cpp @@ -195,6 +195,7 @@ RemoteMemoryAccessor::_GetAreaNoThrow(const void *address, int32 size, Area *&_a class SymbolLookup::LoadedImage : public Image { public: LoadedImage(SymbolLookup* symbolLookup, + const image_info& info, const image_t* image, int32 symbolCount); virtual ~LoadedImage(); @@ -550,8 +551,8 @@ SymbolLookup::_LoadImageInfo(const image_info& imageInfo) if (loadedImage == NULL) return B_OK; - image = new(std::nothrow) LoadedImage(this, loadedImage, - Read(loadedImage->symhash[1])); + image = new(std::nothrow) LoadedImage(this, imageInfo, + loadedImage, Read(loadedImage->symhash[1])); if (image == NULL) return B_NO_MEMORY; @@ -566,27 +567,14 @@ SymbolLookup::_LoadImageInfo(const image_info& imageInfo) SymbolLookup::LoadedImage::LoadedImage(SymbolLookup* symbolLookup, - const image_t* image, int32 symbolCount) + const image_info& info, const image_t* image, int32 symbolCount) : fSymbolLookup(symbolLookup), fImage(image), fSymbolCount(symbolCount), fLoadDelta(image->regions[0].delta) { - // init info - fInfo.id = fImage->id; - fInfo.type = fImage->type; - fInfo.sequence = 0; - fInfo.init_order = 0; - fInfo.init_routine = (void (*)())fImage->init_routine; - fInfo.term_routine = (void (*)())fImage->term_routine; - fInfo.device = -1; - fInfo.node = -1; - strlcpy(fInfo.name, fImage->path, sizeof(fInfo.name)); - fInfo.text = (void*)fImage->regions[0].vmstart; - fInfo.data = (void*)fImage->regions[1].vmstart; - fInfo.text_size = fImage->regions[0].vmsize; - fInfo.data_size = fImage->regions[1].vmsize; + fInfo = info; }