Merge RAddr.cmd and reladdr2line.cmd

Remove my RAddr.cmd
Add reladdr2line.cmd instead

svn path=/trunk/tools/RosBE-Windows/; revision=307
This commit is contained in:
Daniel Reimer 2007-07-14 14:50:26 +00:00
parent f196779b34
commit 2c83fca306
3 changed files with 9 additions and 60 deletions

View File

@ -1,50 +0,0 @@
::
:: PROJECT: RosBE - ReactOS Build Environment for Windows
:: LICENSE: GPL - See COPYING in the top level directory
:: FILE: Root/RAddr.cmd
:: PURPOSE: Translates program addresses into file names and
:: line numbers.
:: COPYRIGHT: Copyright 2007 Daniel Reimer <reimer.daniel@freenet.de>
::
::
@echo off
title RAddr2Line...
set 1 = %1
set 2 = %2
::
:: Receive the Parameters and decide what to do.
::
if "%1%" == "" (
goto :MAN
)
if not "%1%" == "" (
if "%2%" == "" (
goto :AUTO1
) else (
goto :EOC
)
)
::
:: If Parameters were set, parse them, if not, ask the user to add them.
::
:MAN
echo Set the Path to the Executable to be examined.
SET /P 1 =
echo Set the Address you wanna analyze inside the Executable.
SET /P 2 =
echo.
goto :EOC
:AUTO1
echo Set the Address you wanna analyze inside the Executable.
echo.
SET /P 2 =
goto :EOC
:EOC
raddr2line "%1%" "%2%"
title ReactOS Build Environment %_VER%

View File

@ -6,4 +6,4 @@ HELP = "%ROSBEBASEDIR%\Help.cmd" $*
MAKE = "%ROSBEBASEDIR%\Build.cmd" $*
MAKEX = "%ROSBEBASEDIR%\Build-Multi.cmd" $*
CHDEFDIR = "%ROSBEBASEDIR%\chdefdir.cmd" $*
RADDR2LINE = "%ROSBEBASEDIR%\RAddr.cmd" $*
RADDR2LINE = "%ROSBEBASEDIR%\reladdr2line.cmd" $*

View File

@ -4,6 +4,7 @@
:: FILE: Root/reladdr2line.cmd
:: PURPOSE: Converts a value to hex and displays it.
:: COPYRIGHT: Copyright 2007 Christoph von Wittich <Christoph_vW@reactos.org>
:: Daniel Reimer <reimer.daniel@freenet.de>
::
::
@echo off
@ -46,13 +47,11 @@ goto :EOC
:EOC
for /f "tokens=2" %%i in ('"objdump -p %1% 2>NUL | findstr ImageBase"') do SET baseaddr=0x%%i
set /a baseaddr += 0x%2%
for /f %%i in ('"echoh %baseaddr%"') do set relbase=%%i
raddr2line "%1%" "%relbase%" 2>NUL
if %%i < %2% (
raddr2line "%1%" "%2%" 2>NUL
)else(
set /a baseaddr += 0x%2%
for /f %%i in ('"echoh %baseaddr%"') do set relbase=%%i
raddr2line "%1%" "%relbase%" 2>NUL
)
title ReactOS Build Environment %_VER%
::%1 Dateiname
::%2 Adresse
::%%i das was objdump rausfindet
::baseaddr = %%i + Adresse