다음 메소드를 호출 할 수 있습니다. C 문자열을 반환합니다.WinDBG에서 C++ 메소드 인스턴스 호출 및 결과 인쇄
GDB에서는이 호출을 사용하여 결과를 인쇄합니다. kCurrentScope
인스턴스를 사용할 수 있도록 호출하기 전에 적절한 스레드와 프레임을 설정해야합니다.
printf "%s\n", mongo::mozjs::kCurrentScope->buildStackString().c_str()
CDB/WinDbg에서이 작업을 수행 할 수있는 방법이 있습니까?
0:002> x mongo!mongo::mozjs::kCurrentScope
000000bb`46c318f0 mongo!mongo::mozjs::kCurrentScope = 0x000000bb`4b7088a0
재미있는 점은 Windows에서도이 기능이 표시되지 않는다는 것입니다. 그것은 상징을 검색
std::string MozJSImplScope::buildStackString() {
JS::RootedObject stack(_context);
if (! JS::CaptureCurrentStack(_context, &stack)) {
return {};
}
JS::RootedString out(_context);
if (JS::BuildStackString(_context, stack, &out, 0)) {
return JSStringWrapper(_context, out.get()).toString();
} else {
return {};
}
}
로 정의된다
0:002> x mongo!*buildStackString*
00007ff7`c387db40 mongo!JS::BuildStackString (struct JSContext *, class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>, unsigned int64)
00007ff7`c3b266cc mongo!`JS::BuildStackString'::`1'::dtor$9 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b266c0 mongo!`JS::BuildStackString'::`1'::dtor$8 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b266b4 mongo!`JS::BuildStackString'::`1'::dtor$1 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b26680 mongo!`JS::BuildStackString'::`1'::dtor$0 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b266e4 mongo!`JS::BuildStackString'::`1'::dtor$3 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b266d8 mongo!`JS::BuildStackString'::`1'::dtor$2 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b266fc mongo!`JS::BuildStackString'::`1'::dtor$5 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b266f0 mongo!`JS::BuildStackString'::`1'::dtor$4 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b26698 mongo!`JS::BuildStackString'::`1'::dtor$7 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
00007ff7`c3b2668c mongo!`JS::BuildStackString'::`1'::dtor$6 (class JS::Handle<JSObject *>, class JS::MutableHandle<JSString *>)
0:002> .call mongo!mongo::mozjs::buildStackString(kCurrentScope)
Couldn't resolve error at 'mongo!mongo::mozjs::buildStackString(kCurrentScope)'
0:002> .call mongo!mongo::mozjs::buildStackString(mongo!mongo::mozjs::kCurrentScope)
Couldn't resolve error at 'mongo!mongo::mozjs::buildStackString(mongo!mongo::mozjs::kCurrentScope)'
은 함수가 인라인되었다고 할 수있다 (일부 제한) pykd와 함께 할 시도 할 수 반환 모든 발신자와 시체는 사용하지 않는 것으로 최적화되어 있습니까? –
인라인되지 않습니다. 상징에서 알 수있는 방법이 있습니까? –