Hello, I would like to set a breakpoint at the 1st line of my function only if the calling function belongs to a specific file, like this:
file ModuleA.c FunctionA FunctionB FunctionC
file ModuleB.c FunctionD
file ModuleC.c TheFunction
I want to halt in TheFunction only if the caller is either FunctionA, FunctionB or FunctionC.
Using a parser I found a way to create breakpoints at all TheFunction calls inside ModuleA, unfortunately there are too many occurrences so the number of available breakpoints is not sufficient.
So my idea would have been to set a conditional breakpoint in TheFunction, reading LR and checking if its value is in ModuleA.c
So I just did some map file parsing, in order to get the address range of ModuleA.c. Everything went well until I tested and discovered that conditional breakpoints are not available!?!? See:
BS TheFunction && (LR > 0x080053dc && LR < (0x080053dc + 0x00003644)) *** error 129: target does not support conditional breakpoints
What can I do then??? I saw there is a possibility to execute a function in the "bs" command, but it doesn't halt the processor, which I need. And I haven't found a way to execute a "stop" command from the command line, only the button is available. (why so??? go is available, why no stop?)
Is there any way to solve my issue?
Regards
I forgot to specify that I'm doing this all from the debugger command line. As I'm in fact, calling uV5 from python using the dll, I can't press any debugger button...
This in't an answer to your problem, but when I need advanced breakpoints - or many breakpoints - I normally make use of a dedicated function master_breakpoint() that doesn't do anything. But I set a breakpoint on this function, which means I get a breakpoint whenever some code section calls this function.
So I write
if (some_magic_condition) { master_breakpoint(); }
...
// Dummy function, allowing a single hardware breakpoint to get trigged from // lots of different places in the code - or after special conditions. void master_breakpoint(void) { }
I was about to do something quite similar, using an encapsulation of my function TheFunction only in my ModuleA.c The problem of this solution is that I need to modify the target source code... which means also that this solution will not work for all modules (I will need to do the same breakpoint setting in another set of tests, for another module)...
Hello, So, I'm still stuck with this problem of conditional breakpoints... I have now written a function for the debugger, which does what I want. The problem is again that I need to stop the target ! What's incredible is that I can stop the target from my python program, calling the dll. But I can't find a way to stop it from the debugger's command line!?