Skip to content

Commit

Permalink
gdbtrace.init: Fix describeETM definition.
Browse files Browse the repository at this point in the history
Fixes #120
  • Loading branch information
zyp committed Sep 22, 2023
1 parent fa25ab3 commit 7809380
Showing 1 changed file with 93 additions and 88 deletions.
181 changes: 93 additions & 88 deletions Support/gdbtrace.init
Original file line number Diff line number Diff line change
Expand Up @@ -339,106 +339,111 @@ define describeETM
#set language c

if (((*$TRCDEVARCH)&0xfff0ffff) ==0x47704a13)
echo ETMv4.
output (((*$TRCDEVARCH)>>16)&0x0f)
echo \n
set $i=0
while $i<8
echo ETMv4.
output (((*$TRCDEVARCH)>>16)&0x0f)
echo \n
set $i=0
while $i<8
output $i
echo :
output/x *($TRCIDR0+4*$i)
set $i = $i+1
echo \n
end
if (((*$TRCIDR0)>>1)&3==3)
echo Tracing of Load and Store instructions as P0 elements is supported\n
else
echo Tracing of Load and Store instructions as P0 elements is not supported\n
end

if (((*$TRCIDR0)>>3)&3==3)
echo Data tracing is supported\n
else
echo Data tracing is not supported\n
end

if (((*$TRCIDR0)>>5)&1==1)
echo Branch broadcast is supported\n
else
echo Branch broadcast is not supported\n
end

if (((*$TRCIDR0)>>6)&1==1)
echo Conditional Tracing is supported\n
else
echo Conditional Tracing is not supported\n
end

if (((*$TRCIDR0)>>7)&1==1)
echo Instruction Cycle Counting is supported\n
else
echo Instruction Cycle Counting is not supported\n
end

if (((*$TRCIDR0)>>9)&1==1)
echo Return Stacking is supported\n
else
echo Return Stacking is not supported\n
end

if (((*($TRCIDR0+12))>>26)&3==3)
echo Stall is supported\n
else
echo Stalling is not supported\n
end


else
set $etmval = *($ETMBASE+0x1e4)
output ((($etmval>>8)&0x0f)+1)
echo .
output (($etmval>>4)&0x0f)
echo Rev
output (($etmval)&0x0f)
echo \n
if (((($etmval)>>24)&0xff)==0x41)
echo Implementer is ARM\n
end
if (((($etmval)>>24)&0xff)==0x44)

echo Implementer is DEC\n
end
if (((($etmval)>>24)&0xff)==0x4D)
echo Implementer is Motorola/Freescale/NXP\n
end
if (((($etmval)>>24)&0xff)==0x51)
echo Implementer is Qualcomm\n
end
if (((($etmval)>>24)&0xff)==0x56)
echo Implementer is Marvell\n
end
if (((($etmval)>>24)&0xff)==0x69)
echo Implementer is Intel\n
end

if ($etmval&(1<<18))
echo 32-bit Thumb instruction is traced as single instruction\n
end

if (((*$TRCIDR0)>>1)&3==3)
echo Tracing of Load and Store instructions as P0 elements is supported\n
else
echo 32-bit Thumb instruction is traced as two instructions\n
end
if ($etmval&(1<<19))
echo Implements ARM architecture security extensions\n
echo Tracing of Load and Store instructions as P0 elements is not supported\n
end

if (((*$TRCIDR0)>>3)&3==3)
echo Data tracing is supported\n
else
echo No ARM architecture security extensions\n
end
if ($etmval&(1<<20))
echo Uses alternative Branch Packet Encoding\n
echo Data tracing is not supported\n
end

if (((*$TRCIDR0)>>5)&1==1)
echo Branch broadcast is supported\n
else
echo Branch broadcast is not supported\n
end

if (((*$TRCIDR0)>>6)&1==1)
echo Conditional Tracing is supported\n
else
echo Conditional Tracing is not supported\n
end

if (((*$TRCIDR0)>>7)&1==1)
echo Instruction Cycle Counting is supported\n
else
echo Instruction Cycle Counting is not supported\n
end

if (((*$TRCIDR0)>>9)&1==1)
echo Return Stacking is supported\n
else
echo Return Stacking is not supported\n
end

if (((*($TRCIDR0+12))>>26)&3==3)
echo Stall is supported\n
else
echo Uses original Branch Packet Encoding\n
echo Stalling is not supported\n
end

else
set $etmval = *($ETMBASE+0x1e4)
output ((($etmval>>8)&0x0f)+1)
echo .
output (($etmval>>4)&0x0f)
echo Rev
output (($etmval)&0x0f)
echo \n

if (((($etmval)>>24)&0xff)==0x41)
echo Implementer is ARM\n
end
if (((($etmval)>>24)&0xff)==0x44)
echo Implementer is DEC\n
end
if (((($etmval)>>24)&0xff)==0x4D)
echo Implementer is Motorola/Freescale/NXP\n
end
if (((($etmval)>>24)&0xff)==0x51)
echo Implementer is Qualcomm\n
end
if (((($etmval)>>24)&0xff)==0x56)
echo Implementer is Marvell\n
end
if (((($etmval)>>24)&0xff)==0x69)
echo Implementer is Intel\n
end

if ($etmval&(1<<18))
echo 32-bit Thumb instruction is traced as single instruction\n
else
echo 32-bit Thumb instruction is traced as two instructions\n
end

if ($etmval&(1<<19))
echo Implements ARM architecture security extensions\n
else
echo No ARM architecture security extensions\n
end

if ($etmval&(1<<20))
echo Uses alternative Branch Packet Encoding\n
else
echo Uses original Branch Packet Encoding\n
end
end

#set language auto

end

document describeETM
Provide information about the ETM implementation on this target.
end
Expand Down

0 comments on commit 7809380

Please sign in to comment.