feat:adapt faultloggerd modify

Signed-off-by: cs1111 <chenshi51@huawei.com>
Change-Id: I749020a282e2886fe077341c056045ce8f8ae553
This commit is contained in:
cs1111
2025-02-08 17:28:47 +08:00
parent e43c03bde7
commit 69a4bf56ed
@@ -22,6 +22,7 @@
#ifdef SUPPORT_GRAPHICS
#include "ui_content.h"
#endif // SUPPORT_GRAPHICS
#include "elf_factory.h"
#include "unwinder.h"
namespace OHOS {
@@ -113,7 +114,8 @@ std::string NapiUncaughtExceptionCallback::GetBuildId(std::string nativeStack)
while (std::getline(ss, tempStr)) {
auto spitlPos = tempStr.rfind(" ");
if (spitlPos != std::string::npos) {
auto elfFile = std::make_shared<HiviewDFX::DfxElf>(tempStr.substr(spitlPos + 1));
HiviewDFX::RegularElfFactory elfFactory(tempStr.substr(spitlPos + 1));
auto elfFile = elfFactory.Create();
std::string buildId = elfFile->GetBuildId();
if (i != 0 && !buildId.empty()) {
addBuildId += tempStr + "(" + buildId + ")" + "\n";