From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 401 invoked by alias); 6 Jul 2018 03:33:22 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 358 invoked by uid 89); 6 Jul 2018 03:33:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=viewing, H*r:74.6.129, H*c:PHrt, H*x:1.1.12091 X-HELO: sonic301-2.consmr.mail.bf2.yahoo.com Received: from sonic301-2.consmr.mail.bf2.yahoo.com (HELO sonic301-2.consmr.mail.bf2.yahoo.com) (74.6.129.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jul 2018 03:33:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1530847996; bh=sJj15vHv6Qmi9fwkPatM+iNXqYFMKMzGvdDpU7JaXQE=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=sE9KmIe89UWnnFUBB9+2x2ldM9Vrx5BPxOWIq4wRR944WkK7x+G8ue+rH9jsrBZU6PCfrE7CdcyKLHA5b/SP4J/SS6xHCvB7GpTYAR9DRMsXGNDj+YVr9Wj3DflcXqRLPWjeSvViq0c9L+PIt/r5tMaqbPfh8w3qElHFyoCemwa2xRv9CUh2JVwKD1H4ho1vibpZw1d1Pw8GxN21tGK6WCVdyaenpObtebKjOAgi62AqfcS7KGS0ZPtdk2Whg7ZG817dnUJ6xChdP+p1LbBmEtf2Uz0lF2ELLUpj2Z/BC9PepooRTKB5DxBPfI0oZkP0ckJrOLBrjSyn0V6ub2hv+w== Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Fri, 6 Jul 2018 03:33:16 +0000 Date: Fri, 06 Jul 2018 03:33:00 -0000 From: "Mahmood Naderan via gdb" Reply-To: Mahmood Naderan Reply-To: Mahmood Naderan To: "gdb@sourceware.org" Message-ID: <1377359320.54438.1530847991768@mail.yahoo.com> Subject: Viewing the address of an array in gdb MIME-Version: 1.0 References: <1377359320.54438.1530847991768.ref@mail.yahoo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00013.txt.bz2 Hi, I have define "char buffer[100]" in a C code. Trying to view the location o= f buffer in GDB, I see this (gdb) p &buffer[0] $1 =3D 0x7ffff7dd43e0 "" (gdb) x/30x 0x7ffff7dd43e0 0x7ffff7dd43e0 :=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x0= 0000000=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x00000000 0x7ffff7dd43f0 :=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A0= 0x00000000=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x00000000 0x7ffff7dd4400 <_dl_open_hook>:=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 = =C2=A00x00000000=C2=A0=C2=A0 =C2=A00xffb51dd2=C2=A0=C2=A0 =C2=A00xa7d1a586 0x7ffff7dd4410 <__vdso_getcpu>:=C2=A0=C2=A0 =C2=A00xf5b51dd2=C2=A0=C2=A0 = =C2=A00xa7d1a586=C2=A0=C2=A0 =C2=A00xffffdf28=C2=A0=C2=A0 =C2=A00x00007fff 0x7ffff7dd4420 <__libc_argc>:=C2=A0=C2=A0 =C2=A00x00000002=C2=A0=C2=A0 =C2= =A00x00000000=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x00000000 0x7ffff7dd4430 <__gconv_alias_db>:=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0= =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x00000000 0x7ffff7dd4440 <__gconv_modules_db>:=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2= =A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2=A0 =C2=A00x00000= 000 0x7ffff7dd4450 <__gconv_path_envvar>:=C2=A0=C2=A0 =C2=A00x00000000=C2=A0=C2= =A0 =C2=A00x00000000 (gdb) p &buffer[99] $2 =3D 0x7ffff7dd4443 <__gconv_modules_db+3> "" (gdb)=20 Why I don't see and similar things? Regards, Mahmood >From gdb-return-46502-listarch-gdb=sources.redhat.com@sourceware.org Fri Jul 06 11:15:40 2018 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 60353 invoked by alias); 6 Jul 2018 11:15:39 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Delivered-To: mailing list gdb@sourceware.org Received: (qmail 60117 invoked by uid 89); 6 Jul 2018 11:15:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:PHrt, H*RU:74.6.131.42, H*r:ip*74.6.131.42, Hx-spam-relays-external:74.6.131.42 X-HELO: sonic303-3.consmr.mail.bf2.yahoo.com Received: from sonic303-3.consmr.mail.bf2.yahoo.com (HELO sonic303-3.consmr.mail.bf2.yahoo.com) (74.6.131.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jul 2018 11:15:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1530875707; bh=+ICGq2jEUtXmsvF9xyTfTeCjwc3DbBVA4zAWywkNJY4=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=CqCbClKpGFo7/sF4YYcnspeI91Yjnglaie6on8o590BgQ8/qAnEt81GejXTlsMg1RkkTQmJeHguSqBVTv+hXSjD962oTSbEmW+HjN1TdVRoqoXh8fy4Ge62CicKF0bNI5Ldm2YXrVPo8rBAqyZZ7Rj0MwEjZSiBL4siYAIaReh6xV9/lfJYCXIzy2x6qrDahvJhk/0C7vym3gjs8v77XESaxGS9iSxlsUIKI5qjIQVY0MO+u5Dj3t7U5OuR+OUwdvb8xCF2GSQXkafivgVpI3d7us/gyI/Blnqmpj4RQialQwjWWgn8b2Yq59H0Ee1MtQ0/rqUFmasE5+8awpmwxYQ== Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Fri, 6 Jul 2018 11:15:07 +0000 Date: Fri, 06 Jul 2018 11:15:00 -0000 From: "Mahmood Naderan via gdb" Reply-To: Mahmood Naderan Reply-To: Mahmood Naderan To: "gdb@sourceware.org" Message-ID: <1839186466.17059.1530875705518@mail.yahoo.com> Subject: debugging a callq command MIME-Version: 1.0 References: <1839186466.17059.1530875705518.ref@mail.yahoo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00014.txt.bz2 Content-length: 2712 Hi, Trying to debug an assembly code with gdb, I see that a call function to a = valid address exists but the control won't go to the target address. As you can see, the first instruction is a jmp to 0x7fffffffde7d and there,= it will call 0x7fffffffde70. However, the next instruction is something el= se while the program receives seg fault. (gdb) nexti 0x00007fffffffde6e in ?? () 1: x/20i $pc =3D> 0x7fffffffde6e:=C2=A0=C2=A0 =C2=A0jmp=C2=A0=C2=A0=C2=A0 0x7fffffffde7d =C2=A0=C2=A0 0x7fffffffde70:=C2=A0=C2=A0 =C2=A0pop=C2=A0=C2=A0=C2=A0 %rsi =C2=A0=C2=A0 0x7fffffffde71:=C2=A0=C2=A0 =C2=A0xor=C2=A0=C2=A0=C2=A0 %ecx,%= ecx =C2=A0=C2=A0 0x7fffffffde73:=C2=A0=C2=A0 =C2=A0mov=C2=A0=C2=A0=C2=A0 $0x21,= %cl =C2=A0=C2=A0 0x7fffffffde75:=C2=A0=C2=A0 =C2=A0xorb=C2=A0=C2=A0 $0x35,(%rsi) =C2=A0=C2=A0 0x7fffffffde78:=C2=A0=C2=A0 =C2=A0rex.RX loop 0x7fffffffde75 =C2=A0=C2=A0 0x7fffffffde7b:=C2=A0=C2=A0 =C2=A0jmp=C2=A0=C2=A0=C2=A0 0x7fff= ffffde82 =C2=A0=C2=A0 0x7fffffffde7d:=C2=A0=C2=A0 =C2=A0callq=C2=A0 0x7fffffffde70 =C2=A0=C2=A0 0x7fffffffde82:=C2=A0=C2=A0 =C2=A0pop=C2=A0=C2=A0=C2=A0 %rdi =C2=A0=C2=A0 0x7fffffffde83:=C2=A0=C2=A0 =C2=A0jae=C2=A0=C2=A0=C2=A0 0x7fff= ffffdef2 (gdb) nexti 0x00007fffffffde6e in ?? () 1: x/20i $pc =3D> 0x7fffffffde6e:=C2=A0=C2=A0 =C2=A0jmp=C2=A0=C2=A0=C2=A0 0x7fffffffde7d =C2=A0=C2=A0 0x7fffffffde70:=C2=A0=C2=A0 =C2=A0pop=C2=A0=C2=A0=C2=A0 %rsi =C2=A0=C2=A0 0x7fffffffde71:=C2=A0=C2=A0 =C2=A0xor=C2=A0=C2=A0=C2=A0 %ecx,%= ecx =C2=A0=C2=A0 0x7fffffffde73:=C2=A0=C2=A0 =C2=A0mov=C2=A0=C2=A0=C2=A0 $0x21,= %cl =C2=A0=C2=A0 0x7fffffffde75:=C2=A0=C2=A0 =C2=A0xorb=C2=A0=C2=A0 $0x35,(%rsi) =C2=A0=C2=A0 0x7fffffffde78:=C2=A0=C2=A0 =C2=A0rex.RX loop 0x7fffffffde75 =C2=A0=C2=A0 0x7fffffffde7b:=C2=A0=C2=A0 =C2=A0jmp=C2=A0=C2=A0=C2=A0 0x7fff= ffffde82 =C2=A0=C2=A0 0x7fffffffde7d:=C2=A0=C2=A0 =C2=A0callq=C2=A0 0x7fffffffde70 =C2=A0=C2=A0 0x7fffffffde82:=C2=A0=C2=A0 =C2=A0pop=C2=A0=C2=A0=C2=A0 %rdi =C2=A0=C2=A0 0x7fffffffde83:=C2=A0=C2=A0 =C2=A0jae=C2=A0=C2=A0=C2=A0 0x7fff= ffffdef2 (gdb) nexti Program received signal SIGSEGV, Segmentation fault. 0x00007fffffffde8c in ?? () 1: x/20i $pc =3D> 0x7fffffffde8c:=C2=A0=C2=A0 =C2=A0out=C2=A0=C2=A0=C2=A0 %eax,$0x5f =C2=A0=C2=A0 0x7fffffffde8e:=C2=A0=C2=A0 =C2=A0ds insl (%dx),%es:(%rdi) =C2=A0=C2=A0 0x7fffffffde90:=C2=A0=C2=A0 =C2=A0addr32 pop %rbp =C2=A0=C2=A0 0x7fffffffde92:=C2=A0=C2=A0 =C2=A0sbb=C2=A0=C2=A0=C2=A0 0x46(%= rdi),%cl =C2=A0=C2=A0 0x7fffffffde95:=C2=A0=C2=A0 =C2=A0pop=C2=A0=C2=A0=C2=A0 %rbp =C2=A0=C2=A0 0x7fffffffde96:=C2=A0=C2=A0 =C2=A0pop=C2=A0=C2=A0=C2=A0 %rbp =C2=A0=C2=A0 0x7fffffffde97:=C2=A0=C2=A0 =C2=A0sbb=C2=A0=C2=A0=C2=A0 0x5c(%= rdi),%dl What is happening there? Any idea? Regards, Mahmood >From gdb-return-46503-listarch-gdb=sources.redhat.com@sourceware.org Fri Jul 06 11:31:08 2018 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 57426 invoked by alias); 6 Jul 2018 11:30:59 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Delivered-To: mailing list gdb@sourceware.org Received: (qmail 56158 invoked by uid 89); 6 Jul 2018 11:30:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Baldwin, baldwin, sk:decr_af, sk:decr_pc X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jul 2018 11:30:28 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AE16E9003; Fri, 6 Jul 2018 11:30:18 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D9857C21; Fri, 6 Jul 2018 11:30:17 +0000 (UTC) Subject: Re: RISC-V: decr_pc_after_break causing problems To: John Baldwin , Palmer Dabbelt , Jim Wilson , andrew.burgess@embecosm.com References: <95eb8848-182b-dab4-f9dc-298269885f53@FreeBSD.org> Cc: gdb@sourceware.org From: Pedro Alves Message-ID: Date: Fri, 06 Jul 2018 11:30:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <95eb8848-182b-dab4-f9dc-298269885f53@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-07/txt/msg00015.txt.bz2 Content-length: 299 On 07/05/2018 11:54 PM, John Baldwin wrote: > FWIW, my preference would be for the decr_after_pc_break match the hardware > which from my understanding of the thread means it should always be zero. Mine too, FWIW. PC adjustment is a source of trouble in ports that need it. Thanks, Pedro Alves