我正在使用gdb客户端服务器模式来调试android本机代码。我可以在代码中设置断点但是在断点命中之后,我希望打印变量值,但它似乎不起作用:
(gdb) list
4377 AString mime;
4378
4379 AString componentName;
4380 uint32_t quirks = 0;
4381 int32_t encoder = false;
4382 if (msg->findString("componentName", &componentName)) {
4383 ssize_t index = matchingCodecs.add();
4384 OMXCodec::CodecNameAndQuirks *entry = &matchingCodecs.editItemAt(index);
4385 entry->mName = String8(componentName.c_str());
4386
(gdb) print componentName
No symbol "componentName" in current context.
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0xb65014be frameworks/av/media/libstagefright/ACodec.cpp:4382
breakpoint already hit 1 time
我将断点设置为4382行,但在它断开之后,当我尝试打印变量" componentName"时,它告诉我"没有符号" componentName"在当前的背景下#34;。它完全停在那条线上,但为什么它不在当前的背景下?