我有一个我想调试的方法:
-(void)doAThingWithObject:(BaseDataObject *)dataObject //called VERY often
Run Code Online (Sandbox Code Playgroud)
我在这个方法中有一个Xcode断点,我只希望在BaseDataObject的某个子类上断点,所以我添加一个带有条件的断点来检查该类:
[dataObject isKindOfClass:[SubClassOfBaseDataObject class]]
但是,这样做会导致解析错误!
Stopped due to an error evaluating condition of breakpoint 11.1: "[dataObject isKindOfClass:[SubClassOfBaseDataObject class]]"
Couldn't parse conditional expression:
error: no known method '+class'; cast the message send to the method's return type
error: 1 errors parsing expression
Run Code Online (Sandbox Code Playgroud)
我已确保导入文件中的所有类,但调试器不知道我在条件中引用了哪个类.
但是,在断点之前的方法内创建所述Class的临时变量:
Class subClassCheck = [SubClassOfBaseDataObject class];
Run Code Online (Sandbox Code Playgroud)
并更新断点条件以引用临时变量:
[dataObject isKindOfClass:subClassCheck]
Run Code Online (Sandbox Code Playgroud)
没有错误.
对于断点条件,我有点新手,有人可以解释为什么我的第一种方法不起作用吗?
使用rails时,可以看到由活动记录生成的sql - 使用asp.net mvc应用程序可以实现这样的功能吗?
我已经添加了这个额外的文本来满足标准所以只是忽略它(也许我的问题太短了)
我正在尝试使用该debugger;语句在Firefox中调试JS,但YUI Compressor正在干扰.
在未压缩的文件中,但在压缩文件中不会发生Firefox的完全暂停.对于调试,我想使用该debugger;语句,因为当YUI将所有内容整齐地放入一行时,手动设置断点是不可能的.
现在,YUI debugger;从源代码中删除了该语句.
有没有办法保留debugger;声明?
我正在尝试将调试日志添加到我的C#.net代码中.但它弄乱了我的代码,它看起来像一个地狱.有没有什么能够自动记录每个代码的值?现在看起来像这样
#if DEBUG
debuglogger("The functionstarted");
#endif
someCode1();
#if DEBUG
debuglogger("SomeCode1 Finished");
#endif
someCode2();
#if DEBUG
debuglogger("SomeCode2 Finished");
#endif
someCode3();
#if DEBUG
debuglogger("SomeCode3 Finished");
#endif
#if DEBUG
debuglogger("Function End");
#endif
Run Code Online (Sandbox Code Playgroud) 我在一台安装在Windows 7机器上的虚拟机中的ubuntu上运行了一个django站点.我有NAT端口转发.我可以从局域网内的其他机器/平板电脑上找到nginx/uwsgi服务器.要在pycharm中调试站点,我停止nginx和uwsgi并使用pycharm的django服务器,如果我从ubuntu中的浏览器访问服务器,我可以单步调试代码.但是,出于某种原因,我无法从ubuntu之外的浏览器中访问pycharm的django服务器.
这对我来说很奇怪.我没有网络问题,因为我可以很好地点击nginx服务器.Pycharm的django服务器运行正常,因为我可以从ubuntu中的浏览器中找到它.我不知道为什么我不能从外部命中pycharm的django服务器,就像我可以使用nginx服务器一样.
有人可以提供解释吗?谢谢.
调试时我遇到了这个有趣的行为:
十六进制值字符串的a长度是其他值的两倍.

你能说出为什么会这样吗?
我的服务崩溃了,我有这个堆栈跟踪.我无法从这里推断出任何东西
00007f859cd27834 __gnu_cxx::__verbose_terminate_handler()
@ 00007f859cd25865 __cxxabiv1::__terminate(void (*)())
@ 00007f859cd25892 std::terminate()
@ 00007f859cd263be __cxa_pure_virtual
@ 0000000001996f9f My::Class::~Class()
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?
我正在运行Fedora 20(GNOME)并试图将monodevelop用于我的C++类.我安装了gbd附加组件和xterm.当我尝试调试它时会抛出错误:
System.InvalidOperationException:无法创建控制台.在MonoDevelop.Debugger.Gdb.GdbSession.OnRun(Mono.Debugging.Client.DebuggerStartInfo startInfo)[0x00000] in:0 at Mono.Debugging.Client.DebuggerSession + c__AnonStorey1.<> m__0()[0x00000] in:0
我发现了这个问题:https://github.com/aBothe/Mono-D/issues/396
解决方案似乎是删除gnome-terminal或确保xterm不是到另一个终端的符号链接.我宁愿预先形成后者,但我不确定如何完成该解决方案.
我想在gdb中杀死一个特定的线程.这是我将程序附加到gdb的方法.
(gdb) r ./bin/myProg arg1 arg2
Run Code Online (Sandbox Code Playgroud)
我得到当前运行的线程
(gdb) info threads
3 Thread 0x7ffff61fe700 (LWP 28549) 0x000000323b6db7ad in foo () from /lib64/libc.so.6
* 2 Thread 0x7ffff6bff700 (LWP 28548) bar () at ./src/myProg.c:229
1 Thread 0x7ffff7506740 (LWP 28547) 0x000000323be0822d in pthread_join () from /lib64/libpthread.so.0
Run Code Online (Sandbox Code Playgroud)
这是我试图杀死一个线程(比如线程3)
(gdb)t 3
[Switching to thread 3 (Thread 0x7ffff61fe700 (LWP 28549))]#0 foo () at ./src/myProg.c:288
(gdb)call raise(3,0)
Run Code Online (Sandbox Code Playgroud)
在这里我假设了raiseas 的签名raise(threadId as displayed in the gdb, signo as 0)
但线程并没有被杀死.我应该使用不同的signo还是线程ID错误?
注意:我在SO中阅读了这个问题,但这对我没有帮助

在SharpDevelop中编译Windows应用程序时如何写入控制台?我想看看在某种方法中生成哪些随机数用于调试目的.
debugging ×10
c# ×3
c ×2
c++ ×2
gdb ×2
asp.net-mvc ×1
console ×1
django ×1
fedora ×1
gcc ×1
integer ×1
ios ×1
long-integer ×1
monodevelop ×1
objective-c ×1
pycharm ×1
sharpdevelop ×1
windows ×1
xcode ×1
xcode5 ×1
xterm ×1