Roswin.gdb
From ReactOS
| | This page is a candidate for speedy deletion If you disagree with its speedy deletion, please explain why on its talk page.
Watch also the Criteria for speedy deletion! |
| This page is a short article on something that should have a lot more information written on it. If you know anything else about it, you are STRONGLY encouraged to add the information in. If you are unsure of proper formatting or style, add it to the talk page or this page itself as you think best and others will help. |
define log_to_file
set logging file $arg0
set logging redirect on
set logging overwrite on
set logging on
end
define end_log
set logging off
end
define load-module-nostrip
set $modname = $arg0
set $modaddr = $arg1
printf "Loading module symbols at 0x%x\n", $modaddr
set $i = 0
while (((char *)$modname)[$i] != '.' && ((char *)$modname)[$i] != 0)
set $i = $i + 1
end
if (((char *)$modname)[$i] == '.')
set ((char *)$modname)[$i] = 0
end
log_to_file findsym.cmd
printf "for /f \"usebackq\" %%%%i in (`dir /s /b d:\\reactos\\output-i386\\%s.nostrip.*`) do (\nset x=\"%%%%i\"\nset y=!x:\\=/!\necho add-symbol-file !y! 0x%x\n) >> findsym.gdb\n", $modname, $modaddr
end_log
shell cmd /e:on /v:on /c .\findsym.cmd
end
define copy-module-name
set $ndx = 0
while (((LDR_DATA_TABLE_ENTRY*)$modinf)->BaseDllName.Buffer[$ndx])
set ((char *)$name)[$ndx] = ((LDR_DATA_TABLE_ENTRY*)$modinf)->BaseDllName.Buffer[$ndx]
set $ndx = $ndx + 1
end
set ((char *)$name)[$ndx] = 0
end
define load-all-modules
set $stack_space = $esp - 1024
set $name = $stack_space
set $modinf = PsLoadedModuleList->Flink
set $modinf = ((PLIST_ENTRY)$modinf)->Flink
shell del /q findsym.gdb
while ($modinf != &PsLoadedModuleList)
copy-module-name
printf "Loading symbols for %s\n", ((char *)$name)
load-module-nostrip $name (((PLDR_DATA_TABLE_ENTRY)$modinf)->DllBase+0x1000)
set $modinf = ((PLIST_ENTRY)$modinf)->Flink
end
source findsym.gdb
end
define print-modules
set $stack_space = $esp - 1024
set $name = $stack_space
set $modinf = PsLoadedModuleList->Flink
while ($modinf != &PsLoadedModuleList)
copy-module-name
printf "%s \t(%08x)\n", ((char *)$name), (((PLDR_DATA_TABLE_ENTRY)$modinf)->DllBase+0x1000)
set $modinf = ((PLIST_ENTRY)$modinf)->Flink
end
end

