Author: dreimer
Date: Wed Nov 19 08:17:11 2008
New Revision: 37457
URL:
http://svn.reactos.org/svn/reactos?rev=37457&view=rev
Log:
OMG, it works!
Modified:
trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1 [iso-8859-1] Wed Nov 19
08:17:11 2008
@@ -27,7 +27,7 @@
#
$_1 = $args[0]
$_2 = $args[1]
-if ($args.length -bt 2) {
+if ($args.length -gt 2) {
"ERROR: Too many parameters specified."
}
elseif ($args.length -lt 1) {
@@ -54,12 +54,15 @@
if ($_2 -eq $null) {
"ERROR: You must specify a address to analyze."
}
-$baseaddr = (objdump -p $_1 2>NUL | select-string "ImageBase")
+
+$baseaddr = (objdump -p $_1 | select-string "ImageBase").tostring().split()
+$baseaddr = "0x" + ($baseaddr.get($baseaddr.length - 1))
+
if ($baseaddr -lt $_2) {
IEX "& '$_ROSBE_BASEDIR\Tools\raddr2line.exe' '$_1'
'$_2'"
} else {
- $baseaddr = $baseaddr + 0x$_2
- $relbase = "{0:X}" -f $baseaddr
+ $baseaddr = ($baseaddr | % {[Convert]::ToInt32($_,16)}) + ($_2 | %
{[Convert]::ToInt32($_,16)})
+ $relbase = "0x" + ("{0:X}" -f $baseaddr)
IEX "& '$_ROSBE_BASEDIR\Tools\raddr2line.exe' '$_1'
'$relbase'"
}