0

Iam trying to remotely control the trace32 and trying to add commands from pyhton, in this process i have to set break point using python but i cannot set as its saying the function name is not defined (i have already flashed my hex and elf) other functions such as symbol name is working well

import lauterbach.trace32.rcl as t32
dbg = t32.autoconnect()
self = dbg.symbol.query_by_name(name='ComMainFunctionTx')
print(self) 
bp = dbg.breakpoint.set(*"ComComMainFunctionTx ",**())

This is my output iam not understanding what to keep here for mapping

ComComMainFunctionTx P:0x801bacf0 930
Traceback (most recent call last):
  File "c:\Users\Desktop\test hello.py", line 24, in <module>
    bpt=dbg.breakpoint.set(*"ComComMainFunctionTx ",**())
TypeError: lauterbach.trace32.rcl._rc._breakpoint.BreakpointService.set() argument after ** must be a mapping, not tuple

update this is what iam trying to do , iam adding dbg.go_return() to go to the next breakpoint but its throwing timedout error please help if i manually press go button its going to the next breakpoint in trace32 but giving bp.go() its giving timedout error

data=pd.read_csv("useR1.csv")
# converting column data to list
ARG = data['Arguments'].tolist()
for i in ARG:
  mysys = dbg.symbol.query_by_name(name=i)
  bp = dbg.breakpoint.set(address=mysys.address)
dbg.go_return()  
Break
  File "c:\Users\Desktop\IT_Script\test hello.py", line 70, in <module>
    dbg.go_return()
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\lauterbach\trace32\rcl\rcl.py", line 429, in go_return
    self.cmd("Go.Return")
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\lauterbach\trace32\rcl\_rc\_command.py", line 16, in __call__
    self.__conn._cmd(cmd)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\lauterbach\trace32\rcl\rcl.py", line 284, in _cmd
    self.__library.t32_executecommand(cmd.encode(), 4096)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\lauterbach\trace32\rcl\_rc\_library.py", line 429, in t32_executecommand
    return self.generic_api_call(
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\lauterbach\trace32\rcl\_rc\_library.py", line 313, in generic_api_call
    recv_data = self._link.receive()
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\lauterbach\trace32\rcl\_rc\hlinknet.py", line 649, in receive
    raise ApiConnectionTimeoutError(str(e)) from None
lauterbach.trace32.rcl._rc._error.ApiConnectionTimeoutError: timed out

1 Answers1

0

This should work:

import lauterbach.trace32.rcl as t32
dbg = t32.autoconnect()
sym = dbg.symbol.query_by_name(name='ComMainFunctionTx')
print(sym)
bp = dbg.breakpoint.set(address=sym.address)
print(bp)
dev15
  • 665
  • 3
  • 14
  • Thanks @dev15 it help very much , is it possible to take the multiple breakpoint from a csv import ? i know i have to ask in a new question , please excuse this one time. – Lakshmi Srikanta Jul 25 '22 at 12:21
  • Sure you can have a list of the symbol names in a CSV file and read them using the CSV module (https://docs.python.org/3/library/csv.html). – dev15 Jul 25 '22 at 12:53
  • yes iam currently reading it using a loop in a list its good but in general some breakpoints will fail to set is there a way to upadte in the same csv as pass or fail ? – Lakshmi Srikanta Jul 25 '22 at 13:17
  • hi @dev15 the breakpoints are setting but the syatem is not going to the next breakpoint in breakpoint list instead its stopping at the first one using dbg.go_return() or dbg.go() are making the error raise ApiConnectionTimeoutError(str(e)) from None lauterbach.trace32.rcl._rc._error.ApiConnectionTimeoutError: timed out please help – Lakshmi Srikanta Jul 26 '22 at 06:16
  • "is not going to the next breakpoint in breakpoint list instead its stopping at the first one" This is to be expected, the processor will halt at the first breakpoint, there's no breakpoint order. – dev15 Jul 26 '22 at 08:19