Skip to main content

How to set a breakpoint at a specific line in a specific file via pyrcl - Community / Test Automation - Lauterbach Support

0

How to set a breakpoint at a specific line in a specific file via pyrcl Awaiting Agent

hello lauterbach team,
I am trying use pyrcl to set breakpoint, now I can set breakpoint by address/function via Break.Set command, but I am not able to set breakpoints with code file and line numbers, I want know how to implement it?
def setBreakpointAtFunctionOffset(self, function: str, offset: int):
cmd = rf'Break.Set {function}\{offset}'
self.dbg.cmd(cmd)

def setBreakpointAtAddress(self, address: int):
cmd = f'Break.Set {hex(address).upper()}'
self.dbg.cmd(cmd)

def setBreakpointAtFunction(self, function: str):
cmd = f'Break.Set {function}'
self.dbg.cmd(cmd)

Comments (3)

Wiem Wala Benayed

This is possible using :

def setBreakpointAtFileLine(self,file: str, line:int):

cmd = f'Break.Set \{file}\{line}'

self.dbg.cmd(cmd)



Huiyang ZHANG
hello Wiem, Thank you for your answer, I tried this implementation, but not work and raise a exception: lauterbach.trace32.rcl._rc._command.CommandError: ('symbol not found', 'command: ', b'Break.Set \\COMH.c\\42') I tried full path and file name only, but both not work t32_mgr.setBreakpointAtFileLine(f"main.c", 344) t32_mgr.setBreakpointAtFileLine(f"/path/to/my/main.c", 344) my trace32 version is R.2025.02, Is there an API update for the new trace32?
Wiem Wala Benayed

You should use :

t32_mgr.setBreakpointAtFileLine(f"main", 344)


Add a comment

ID-0
To prove you are a human, please tell us the text you see in the CAPTCHA image