Xcode 中的 po 命令不生成输出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16287299/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:18:09  来源:igfitidea点击:

po command in Xcode does not generate output

iosxcodegdblldb

提问by cheesus

At some point during my work, Xcode's poand pcommands stopped working. No matter what I enter, it doesn't generate output:

在我工作的某个时候,Xcodepop命令停止工作。无论我输入什么,它都不会生成输出:

(gdb) po self
(gdb) po [self name]
(gdb) po [UITableView class]
(gdb) po @"Hello"
(gdb) p indexPath.row
(gdb) print indexPath.row
(gdb) po fjkldsjflksdjklwjfkljfkldsjflk
(gdb)

When I enter any of these commands, the command line just goes to the next line, where it prints the blue (gdb), but no output.

当我输入这些命令中的任何一个时,命令行只会转到下一行,在那里打印 blue (gdb),但没有输出。

I tried the following steps:

我尝试了以下步骤:

  • Restart Xcode, restart my Macbook
  • Tried while debugging in the simulator as well as on a iOS device
  • Switched to LLDB and restarted
  • Re-installed Xcode
  • 重启 Xcode,重启我的 Macbook
  • 在模拟器和 iOS 设备上调试时试过
  • 切换到LLDB并重新启动
  • 重新安装Xcode

The other debugging tools in Xcode seem to work okay: Breakpoints, step-by-step execution, the Autovariable examination window etc.

Xcode 中的其他调试工具似乎工作正常:断点、逐步执行、自动变量检查窗口等。

Any ideas?

有任何想法吗?

EDIT:Doesn't work even after a re-install of Xcode.

编辑:即使在重新安装 Xcode 后也不起作用。

回答by cheesus

Silly me, I was in the 'Target Output' window instead of the 'Debugger Output' window.

愚蠢的我,我在“目标输出”窗口而不是“调试器输出”窗口中。

enter image description here

在此处输入图片说明

Somehow I thought I checked the other console windows there, but apparently I didn't.

不知何故,我以为我检查了那里的其他控制台窗口,但显然我没有。

回答by nefarianblack

enter image description here

在此处输入图片说明

I added filter in debugger which hid other logs. Removing the filter worked for me.

我在调试器中添加了过滤器,它隐藏了其他日志。移除过滤器对我有用。