-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2003 Ada Core Technologies, Inc. --
+-- Copyright (C) 2002-2007, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- All supported architectures
type Architecture is
- (WINDOWS_POWERPC,
+ (SOLARIS_I586,
+ WINDOWS_POWERPC,
+ WINDOWS_I586,
WINDOWS_M68K,
SOLARIS_POWERPC,
DEC_ALPHA);
type Arch_Record is record
Addr2line_Binary : String_Access;
- -- Name of the addr2line utility to use.
+ -- Name of the addr2line utility to use
Nm_Binary : String_Access;
-- Name of the host nm utility, which will be used to find out the
Nm_Binary => null,
Addr_Digits_To_Skip => 0,
Bt_Offset_From_Call => -4),
+ WINDOWS_I586 =>
+ (Addr2line_Binary => null,
+ Nm_Binary => null,
+ Addr_Digits_To_Skip => 0,
+ Bt_Offset_From_Call => -2),
SOLARIS_POWERPC =>
(Addr2line_Binary => null,
Nm_Binary => null,
Addr_Digits_To_Skip => 0,
Bt_Offset_From_Call => 0),
+ SOLARIS_I586 =>
+ (Addr2line_Binary => null,
+ Nm_Binary => null,
+ Addr_Digits_To_Skip => 0,
+ Bt_Offset_From_Call => -2),
DEC_ALPHA =>
(Addr2line_Binary => null,
Nm_Binary => null,
return;
end Detect_Arch;
-
-----------
-- Error --
-----------
raise Program_Error;
end Error;
-
--------------------------
-- Get_Reference_Offset --
--------------------------
return Value;
end;
- -- We can not get here
+ -- We cannot get here
raise Program_Error;
Error ("Couldn't find " & Arch_List (Cur_Arch).Addr2line_Binary.all);
end if;
- -- The first argument specifies the image file. Check if it exists.
+ -- The first argument specifies the image file. Check if it exists
if not Is_Regular_File (Argument (1)) then
Error ("Couldn't find the executable " & Argument (1));
Spawn (Addr2line_Cmd.all,
Addr2line_Args (1 .. Addr2line_Args_Count), Success);
+ if not Success then
+ Error ("Couldn't spawn " & Addr2line_Cmd.all);
+ end if;
+
exception
when others =>