mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
stackgetter get recordname by GetRecordNameWithSymbol
issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7KQG9 Signed-off-by: Chongwei Su <suchongwei@huawei.com>
This commit is contained in:
parent
11c5ad5924
commit
fe86bbf709
@ -81,9 +81,9 @@ bool JsStackGetter::ParseMethodInfo(struct MethodKey &methodKey,
|
||||
return false;
|
||||
}
|
||||
// record name
|
||||
CString recordNameStr = MethodLiteral::GetRecordName(jsPandaFile, methodId);
|
||||
if (!recordNameStr.empty()) {
|
||||
if (!CheckAndCopy(codeEntry.recordName, sizeof(codeEntry.recordName), recordNameStr.c_str())) {
|
||||
const char *recordName = MethodLiteral::GetRecordNameWithSymbol(jsPandaFile, methodId);
|
||||
if (strlen(recordName) != 0) {
|
||||
if (!CheckAndCopy(codeEntry.recordName, sizeof(codeEntry.recordName), recordName)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -121,6 +121,18 @@ CString MethodLiteral::GetRecordName(const JSPandaFile *jsPandaFile, EntityId me
|
||||
return JSPandaFile::ParseEntryPoint(desc);
|
||||
}
|
||||
|
||||
const char *MethodLiteral::GetRecordNameWithSymbol(const JSPandaFile *jsPandaFile, EntityId methodId)
|
||||
{
|
||||
if (jsPandaFile == nullptr) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const panda_file::File *pf = jsPandaFile->GetPandaFile();
|
||||
panda_file::MethodDataAccessor mda(*pf, methodId);
|
||||
panda_file::ClassDataAccessor cda(*pf, mda.GetClassId());
|
||||
return utf::Mutf8AsCString(cda.GetDescriptor());
|
||||
}
|
||||
|
||||
uint32_t MethodLiteral::GetCodeSize(const JSPandaFile *jsPandaFile, EntityId methodId)
|
||||
{
|
||||
if (jsPandaFile == nullptr) {
|
||||
|
@ -297,6 +297,7 @@ public:
|
||||
static std::string PUBLIC_API ParseFunctionName(const JSPandaFile *jsPandaFile, EntityId methodId);
|
||||
static uint32_t GetCodeSize(const JSPandaFile *jsPandaFile, EntityId methodId);
|
||||
static CString GetRecordName(const JSPandaFile *jsPandaFile, EntityId methodId);
|
||||
static const char PUBLIC_API *GetRecordNameWithSymbol(const JSPandaFile *jsPandaFile, EntityId methodId);
|
||||
|
||||
const uint8_t *GetBytecodeArray() const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user