Skip to content

Commit

Permalink
btrace: Add type casting feature for saved variables
Browse files Browse the repository at this point in the history
Signed-off-by: iipeace <[email protected]>
  • Loading branch information
iipeace committed Dec 10, 2023
1 parent e036b35 commit fc05d5b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions guider/guider.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__credits__ = "Peace Lee"
__license__ = "GPLv2"
__version__ = "3.9.8"
__revision__ = "231207"
__revision__ = "231210"
__maintainer__ = "Peace Lee"
__email__ = "[email protected]"
__repository__ = "https://github.com/iipeace/guider"
Expand Down Expand Up @@ -34985,7 +34985,7 @@ def printHelp(force=False, isExit=True):
rdmem print specific memory or register [VAR|ADDR|REG:SIZE]
repeat call again repeatedly [CNT]
ret return specific value immediately [VAL]
save save previous value [VAR]
save save previous or specific or argument value [VAR:VAL:TYPE]
setarg change value for specific register [REG#VAR|VAL]
setenv change specific environment variable [VAR:VAR|VAL]
setret change return value [VAL:CMD]
Expand Down Expand Up @@ -35341,6 +35341,7 @@ def printHelp(force=False, isExit=True):

- {5:1} {7:1} and run multiple commands when specific function calls return
# {0:1} {1:1} {9:1} -c "write|getret:sleep:1\\$exec:ls\\$stop"
# {0:1} {1:1} {9:1} -c "write|getret:save:VAR1\\$rdmem:@VAR1"

- {5:1} {7:1} and print resource usage for tasks
# {0:1} {1:1} {9:1} -c "*loadData*|getret:proctop:a.out|proctop:a.out"
Expand Down Expand Up @@ -35386,9 +35387,11 @@ def printHelp(force=False, isExit=True):
- {5:1} and print python contexts {4:1} {7:1}
# {0:1} {1:1} {9:1} -c "write|print" -q PYSTACK

- {5:1} and save specific values to specific variables {4:1} {7:1}
# {0:1} {1:1} {9:1} -c "write|save:VAR1|print:VAR1|save:VAR2:123"
- {5:1} and save specific values to specific variables and handle them {4:1} {7:1}
# {0:1} {1:1} {9:1} -c "write|save:VAR1:123|print:VAR1"
# {0:1} {1:1} {9:1} -c "write|save:ARG1:1:arg|print:VAR1"
# {0:1} {1:1} {9:1} -c "write|save:VAR1:1|save:VAR1:@VAR1:float|print:VAR1"
# {0:1} {1:1} {9:1} -c "write|getret|save:VAR1|print:VAR1"

- {5:1} and print call contexts if only specific conditions are met {4:1} {7:1}
# {0:1} {1:1} {9:1} -c "write|filter:2:EQ:4096"
Expand Down Expand Up @@ -83347,12 +83350,17 @@ def _getFunc():
cmdlist = cmdset[1].split(":")
var = cmdlist[0]

# set target data #
if len(cmdlist) == 1:
data = self.prevReturn
else:
data = cmdlist[1]
if not data:
data = self.prevReturn
elif data.startswith("@") and len(data) > 1:
vardata = self.retList.get(data[1:])
if vardata:
data = vardata

# convert type #
if len(cmdlist) == 3:
Expand Down

0 comments on commit fc05d5b

Please sign in to comment.