Read about our upcoming Code of Conduct on this issue

Commit 499dc25c authored by alex@thinkpad's avatar alex@thinkpad
Browse files

GDB scripts: hooks for logging properties (prop_request_change, MPU property functions)

(example for 5D3.113 and 550D.109; useful for identifying properties)

--HG--
branch : qemu
parent 3c3ebbaa9512
......@@ -41,6 +41,18 @@ if 0
mpu_recv_log
end
# properties
if 0
b *0xFF056E38
prop_request_change_log
b *0xFF1B712C
mpu_analyze_recv_data_log
b *0xFF1B6358
prop_lookup_maybe_log
end
# semaphores
if 0
b *0xFF069D10
......
......@@ -45,4 +45,38 @@ if 0
give_semaphore_log
end
# MPU communication - 1.1.3
if 0
b *0xFF2E42E4
mpu_send_log
b *0xFF122B5C
mpu_recv_log
end
# properties - 1.1.3
if 0
b *0xFF123600
prop_request_change_log
b *0xFF2E6B6C
mpu_analyze_recv_data_log
b *0xFF2E4598
prop_lookup_maybe_log
end
# properties - 1.2.3 (some are different!)
if 0
b *0xFF123210
prop_request_change_log
b *0xFF2EAED0
mpu_analyze_recv_data_log
b *0xFF2E8C78
prop_lookup_maybe_log
end
cont
......@@ -20,4 +20,16 @@ task_create_log
b *0x8FE4
register_interrupt_log
# properties
if 0
b *0xFF12FD6C
prop_request_change_log
b *0xFF30FB5C
mpu_analyze_recv_data_log
b *0xFF30D268
prop_lookup_maybe_log
end
cont
......@@ -34,6 +34,18 @@ if 0
mpu_recv_log
end
# properties
if 0
b *0xFF12AB14
prop_request_change_log
b *0xFF31E250
mpu_analyze_recv_data_log
b *0xFF31B408
prop_lookup_maybe_log
end
# message queues (incomplete)
if 0
b *0x3dd24
......
......@@ -566,7 +566,11 @@ end
define mpu_decode
set $buf = $arg0
set $size = ((char*)$buf)[0]
if $argc == 2
set $size = $arg1
else
set $size = ((char*)$buf)[0]
end
set $i = 0
while $i < $size
printf "%02x ", ((char*)$buf)[$i]
......@@ -600,6 +604,62 @@ define mpu_recv_log
end
end
define mpu_analyze_recv_data_log
commands
silent
#print_current_location
#printf "AnalyzeMpuReceiveData %x %x %x %x\n", $r0, $r1, $r2, $r3
print_current_location
printf "MPU property: %02x %02x ", *(int*)$r1, *(int*)($r1+4)
mpu_decode *(int*)($r1+8) *(int*)($r1+12)
printf "\n"
c
end
end
# called many times; string: NOT PROPERTYLIST ID
define prop_lookup_maybe_log
commands
silent
print_current_location
printf "prop_lookup_maybe %x %x %x %x\n", $r0, $r1, $r2, $r3
c
end
end
define prop_print_data
set $buf = $arg0
set $size = $arg1 / 4
set $i = 0
while $i < $size
printf "%08x ", ((unsigned int *)$buf)[$i]
set $i = $i + 1
end
if $arg1 % 4 == 3
printf "%06x ", ((unsigned int *)$buf)[$i] & 0xFFFFFF
end
if $arg1 % 4 == 2
printf "%04x ", ((unsigned int *)$buf)[$i] & 0xFFFF
end
if $arg1 % 4 == 1
printf "%02x ", ((unsigned int *)$buf)[$i] & 0xFF
end
end
define prop_request_change_log
commands
silent
print_current_location
KRED
printf "prop_request_change"
KRESET
printf " %08X { ", $r0
prop_print_data $r1 $r2
printf "}\n"
c
end
end
define try_expand_ram_struct
if $arg0 > 0x1000 && $arg0 < 0x1000000
printf " "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment