conditional-breakpoint

Lldb : Setting conditional breakpoint with string equality as condition

允我心安 提交于 2021-02-07 05:25:31
问题 I would like to set a conditional breakpoint with lldb. This is usually done using -c option : breakpoint set -f myFile.cpp -l 123 -c 'a==3' However, in my case I want to test if a std::string object is equal to a certain string value but doing this breakpoint set -f myFile.cpp -l 123 -c 'a=="hello"' does not work… Lldb does not complain (while gdb would return an error) but it ignores the condition string upon reaching the breakpoint and breaks too early… This question is similar to this one

GDB - strcmp not working: __strcmp_sse2_unaligned

痞子三分冷 提交于 2021-01-27 10:48:01
问题 I'm unable to create conditional breakpoint in GDB using strcmp: break x if strcmp(str.c_str(), "foo") == 0 Why you ask? Because: print strcmp("hello", "hello") Yield's (int (*)(const char *, const char *)) 0x7ffff76ffe70 <__strcmp_sse2_unaligned> Even when casting it to an integer: print (int)strcmp("hello", "hello") It returns some nonsensical value like -143655312 Here's a less graceful way to "solve" my problem. I can define a function in my own code: int mystrcmp(const char *str1, const

GDB - strcmp not working: __strcmp_sse2_unaligned

本秂侑毒 提交于 2021-01-27 10:46:25
问题 I'm unable to create conditional breakpoint in GDB using strcmp: break x if strcmp(str.c_str(), "foo") == 0 Why you ask? Because: print strcmp("hello", "hello") Yield's (int (*)(const char *, const char *)) 0x7ffff76ffe70 <__strcmp_sse2_unaligned> Even when casting it to an integer: print (int)strcmp("hello", "hello") It returns some nonsensical value like -143655312 Here's a less graceful way to "solve" my problem. I can define a function in my own code: int mystrcmp(const char *str1, const

How to use conditional breakpoint in Eclipse?

孤者浪人 提交于 2019-12-27 11:00:33
问题 I want to know how to place a conditional breakpoint in Eclipse. I have a code like: public static void doForAllTabs(String[] tablist){ for(int i = 0; i<tablist.length;i++){ --> doIt(tablist[i]); } } Now I want to put a breakpoint on the line with the arrow but want it to trigger only if: tablist[i].equalsIgnoreCase("LEADDELEGATES"); 回答1: Put your breakpoint. Right-click the breakpoint image on the margin and choose Breakpoint Properties : Configure condition as you see fit: 回答2: Make a

Eclipse conditional breakpoint, break at any string equals

百般思念 提交于 2019-12-13 14:09:15
问题 I have a large (legacy) application that I have to make a fix in, with terrible code structure and so much code smell that I'm choking. I can't really figure out where a string in the gui is populated. Therefore it would be nice if i somehow could have an expression/breakpoint once ANY string (I don't know the name of the variable, or where it is) is equal to "foobar" so I can backtrack from there. So, what am I looking for? :) 回答1: This trick works as long as the string that you want to find

Why does the condition for a breakpoint failed to execute?

谁说胖子不能爱 提交于 2019-12-12 09:30:05
问题 I want to temporarily disable a breakpoint for a short time, so I set a conditional breakpoint with the following condition: (global::System.DateTime.Now<new global::System.DateTime(2014,03,28,11,0,0)) When this breakpoint is hit a dialog pops up, saying The condition for a breakpoint failed to execute. The condition was '(global::System.DateTime.Now<new global::System.DateTime(2014,03,28,11,0,0))'. The error returned was 'The runtime has refused to evaluate the expression at this time.'.

Conditional Debug on Visual C++ 2008 Express

跟風遠走 提交于 2019-12-11 12:51:41
问题 Is there a way to debug code on Visual C++ 2008 Express, such as I can watch a variable for certain value(s) and, when it assumes this value, to break? For instance, I want to break when x becomes 5 . In gdb I would set a breakpoint then a condition that x == 5 . How can I do it (if possible) on Visual C++ 2008 Express? 回答1: Although built in support for it is missing in the express editions, there is another way around it. I found this on another answer for a similar question. #if DEBUG if(

How to set memory breakpoint in Eclipse

可紊 提交于 2019-12-11 01:16:37
问题 Could anyone tell me how to set memory breakpoint in Eclipse (C++)? for example: int a = 0; for(int i = 0; i < 100; i++) { if(i == 50) a = 50; } I want to detect the action when a is assigned to a new value. I know in Visual Studio we should set memory break point by getting the address of a (i.e. &a ). Is there an equivalent way in Eclipse? Your help would be highly appreciated. Thanks. 回答1: maybe this helps: http://www.linuxtopia.org/online_books/eclipse_documentation/eclipse_c_c++_guide

“Condition for a breakpoint failed to execute… 'variable' not declared. It may be inaccessible…” Why?

你离开我真会死。 提交于 2019-12-10 14:58:34
问题 Related questions: Unable to debug managed code using visual studio 2013 ("Cannot evaluate expression" error - am using debug build) (Note that VS 2012 works) VS2013 Debugger + Entity Framework: "runtime has refused to evaluate the expression", crashes I am facing a problem with conditional breakpoints in Visual Studio 2013 Professional. The breakpoint condition is referring to a local variable ( tagString ), which is declared and initialized in the line of code immediately preceding the

Eclipse ADT cannot set conditional breakpoint on SDK sources: missing java Project context

痞子三分冷 提交于 2019-12-10 14:35:54
问题 I am trying to debug a simple Android app with Eclipse 3.7.1. I attachted the Android SDK sources so I can step through the code of the SDK also. I can set unconditional breakpoints on code of the SDK but not conditional breakpoints. I get the following error message if I try: Conditional Breakpoint Error Conditional breakpoint has compilation error(s). Reason: Unable to compile conditional breakpoint - missing java Project context Conditional breakpoints on by own sources work, however. The