From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2041) id 018983858C53; Mon, 25 Jul 2022 22:07:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 018983858C53 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Vladimir Mezentsev To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] gprofng: fix bug 29352 - Fix the message Hexadecimal number > 0xffffffff non-portable X-Act-Checkin: binutils-gdb X-Git-Author: Ruud van der Pas X-Git-Refname: refs/heads/master X-Git-Oldrev: 872ae1027e3a4d344333acf7507a32874444e3b0 X-Git-Newrev: 2e2a82421ac0c817d433d2698ed29ce84d1f1574 Message-Id: <20220725220737.018983858C53@sourceware.org> Date: Mon, 25 Jul 2022 22:07:37 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2022 22:07:37 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2e2a82421ac0= c817d433d2698ed29ce84d1f1574 commit 2e2a82421ac0c817d433d2698ed29ce84d1f1574 Author: Ruud van der Pas Date: Fri Jul 22 06:27:41 2022 -0700 gprofng: fix bug 29352 - Fix the message Hexadecimal number > 0xfffffff= f non-portable =20 gprofng/Changelog: 2022-07-22 Ruud van der Pas =20 PR gprofng/29352 * gp-display-html/gp-display-html.in: the hex subroutine from the bigint module is now used. Diff: --- gprofng/gp-display-html/gp-display-html.in | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gprofng/gp-display-html/gp-display-html.in b/gprofng/gp-displa= y-html/gp-display-html.in index 9b207b99aa8..8297be62b2f 100644 --- a/gprofng/gp-display-html/gp-display-html.in +++ b/gprofng/gp-display-html/gp-display-html.in @@ -1246,8 +1246,8 @@ sub calculate_target_hex_address =20 $length_of_string =3D length ($instruction_offset);=20 $first_char =3D lcfirst (substr ($instruction_offset,0,1)); - $d1 =3D hex ($instruction_offset); - $d2 =3D hex ($mask); + $d1 =3D bigint::hex ($instruction_offset); + $d2 =3D bigint::hex ($mask); # if ($first_char eq "f") if (($first_char =3D~ /[89a-f]/) and ($length_of_string =3D=3D $number_o= f_fields)) { @@ -1258,12 +1258,12 @@ sub calculate_target_hex_address # XOR the decimal representation and add 1 to the result. #-------------------------------------------------------------------------= ----- $result =3D ($d1 ^ $d2) + 1; - $dec_branch_target =3D hex ($instruction_address) - $result; + $dec_branch_target =3D bigint::hex ($instruction_address) - $result; } else { $result =3D $d1; - $dec_branch_target =3D hex ($instruction_address) + $result; + $dec_branch_target =3D bigint::hex ($instruction_address) + $result; } #-------------------------------------------------------------------------= ----- # Convert to hexadecimal. @@ -1765,7 +1765,7 @@ sub check_loadobjects_are_elf gp_message ("debug", $subr_name, "extracted name_path =3D $name_= path name =3D $name"); # $error_extracting_information =3D $TRUE; $executable_name =3D $name; - my $result_VA =3D hex ($vaddr) - hex ($foffset); + my $result_VA =3D bigint::hex ($vaddr) - bigint::hex ($foffset); my $hex_VA =3D sprintf ("0x%016x", $result_VA); $va_executable_in_hex =3D $hex_VA; gp_message ("debug", $subr_name, "set executable_name =3D $exec= utable_name"); @@ -2728,7 +2728,7 @@ sub determine_base_va_address $base_va_address =3D "0x0"; } =20 - my $decimal_address =3D hex ($base_va_address); + my $decimal_address =3D bigint::hex ($base_va_address); gp_message ("debugXL", $subr_name, "return base_va_address =3D $base_va_= address (decimal: $decimal_address)"); =20 return ($base_va_address); @@ -3602,7 +3602,7 @@ sub extract_info_from_map_xml #-------------------------------------------------------------------------= ----- $full_path_exec =3D $name_path; $executable_name =3D $name; - my $result_VA =3D hex ($vaddr) - hex ($foffset); + my $result_VA =3D bigint::hex ($vaddr) - bigint::hex ($f= offset); $va_executable_in_hex =3D sprintf ("0x%016x", $result_VA); =20 ## $ARCHIVES_MAP_NAME =3D $name; @@ -4364,7 +4364,7 @@ sub function_info my ($segment,$offset); $segment =3D $1; $offset =3D $2; - $address_decimal =3D hex ($offset); # decimal + $address_decimal =3D bigint::hex ($offset); # decimal $full_address_field =3D '@'.$segment.":".$offset; # e.g. @2:= 0x0003f280 $order[$index_val]{"addressobj"} =3D $address_decimal; $order[$index_val]{"addressobjtext"} =3D $full_address_field; @@ -5481,7 +5481,7 @@ sub generate_dis_html $hot_line =3D $1; $metric_values =3D $2; $src_line =3D $3; - $dec_instr_address =3D hex ($4); + $dec_instr_address =3D bigint::hex ($4); $instruction =3D $5; $operands =3D $6; =20 @@ -5556,7 +5556,7 @@ sub generate_dis_html $hot_line =3D $1; $metric_values =3D $2; $src_line =3D $3; - $dec_instr_address =3D hex ($4); + $dec_instr_address =3D bigint::hex ($4); $instruction =3D $5; $operands =3D $6; =20 @@ -5711,7 +5711,7 @@ sub generate_dis_html { $branch_address =3D $extended_branch_target{$hex_instr_a= ddress}; =20 - $dec_branch_address =3D hex ($branch_address); + $dec_branch_address =3D bigint::hex ($branch_address); =20 if ( ($dec_branch_address >=3D $dec_instruction_start) a= nd ($dec_branch_address <=3D $dec_instruction_end) ) @@ -7707,7 +7707,7 @@ sub get_function_info #-------------------------------------------------------------------------= ----- # Convert to a base 10 number #-------------------------------------------------------------------------= ----- - $address_decimal =3D hex ($offset); # decimal + $address_decimal =3D bigint::hex ($offset); # decimal #-------------------------------------------------------------------------= ----- # Construct the address field. Note that we use the hex address here. #-------------------------------------------------------------------------= ----- @@ -11139,7 +11139,7 @@ sub process_function_files ##########################################################################= ##### gp_message ("debugXL", $subr_name, "before function_info[$routin= e_index]{addressobj} =3D $function_info[$routine_index]{'addressobj'}"); =20 - $function_info[$routine_index]{"addressobj"} +=3D hex ( + $function_info[$routine_index]{"addressobj"} +=3D bigint::hex ( determine_base_va_address ( $executable_name,=20 $base_va_executable,