From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120502 invoked by alias); 30 Sep 2016 14:09:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 120490 invoked by uid 89); 30 Sep 2016 14:09:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*uweigand, H*x:Release, uweigand@de.ibm.com, uweiganddeibmcom X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Sep 2016 14:09:06 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8UE8AO5081488 for ; Fri, 30 Sep 2016 10:09:04 -0400 Received: from e28smtp01.in.ibm.com (e28smtp01.in.ibm.com [125.16.236.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 25sm6fp430-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 30 Sep 2016 10:09:04 -0400 Received: from localhost by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Sep 2016 19:39:00 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp01.in.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 30 Sep 2016 19:38:58 +0530 X-IBM-Helo: d28dlp02.in.ibm.com X-IBM-MailFrom: sangamesh.swamy@in.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from d28relay08.in.ibm.com (d28relay08.in.ibm.com [9.184.220.159]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id ECD6B3940033 for ; Fri, 30 Sep 2016 19:38:57 +0530 (IST) Received: from e39.co.us.ibm.com (e39.boulder.ibm.com [9.17.249.49]) by d28relay08.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8UE8ijV30408864 for ; Fri, 30 Sep 2016 19:38:45 +0530 Received: from localhost by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Sep 2016 08:08:55 -0600 Received: from smtp.notes.na.collabserv.com (192.155.248.66) by e39.co.us.ibm.com (192.168.2.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128/128) Fri, 30 Sep 2016 08:08:52 -0600 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Fri, 30 Sep 2016 14:08:51 -0000 Received: from us1a3-smtp05.a3.dal06.isc4sb.com (10.146.71.159) by smtp.notes.na.collabserv.com (10.106.227.127) with smtp.notes.na.collabserv.com ESMTP; Fri, 30 Sep 2016 14:08:48 -0000 Received: from us1a3-mail142.a3.dal06.isc4sb.com ([10.146.38.78]) by us1a3-smtp05.a3.dal06.isc4sb.com with ESMTP id 2016093014084836-234413 ; Fri, 30 Sep 2016 14:08:48 +0000 In-Reply-To: <20160929152251.639F511C2C8@oc8523832656.ibm.com> To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org Subject: Re: set sysroot command on AIX has no effect. From: "Sangamesh Mallayya" Date: Fri, 30 Sep 2016 14:15:00 -0000 References: from "Sangamesh Mallayya" at Sep 13, 2016 09:04:34 AM <20160929152251.639F511C2C8@oc8523832656.ibm.com> MIME-Version: 1.0 X-KeepSent: 5271A12B:B6A83109-6525803E:004DA1C1; type=4; name=$KeepSent X-LLNOutbound: False X-Disclaimed: 19087 X-TNEFEvaluated: 1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII" x-cbid: 16093014-7323-0000-0000-0000001230FF X-IBM-ISS-SpamDetectors: Score=0.40962; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.40962; ST=0; TS=0; UL=0; ISC= X-IBM-ISS-DetailInfo: BY=3.00005830; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000186; SDB=6.00763097; UDB=6.00363847; UTC=2016-09-30 14:08:50 x-cbparentid: 16093014-6358-0000-0000-00000106DA44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused X-Content-Scanned: Fidelis XPS MAILER X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-30_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609280000 definitions=main-1609300258 X-SW-Source: 2016-09/txt/msg00427.txt.bz2 Hi Ulrich, Thanks for the review and comments. If we call solib_bfd_open for .a files then the call to open file using=20 gdb_open_cloexec inside solib_find function is failing. The reason for this is, we will be getting library information from ld_info in the form of=20 "/usr/lib/libc.a(shr.o)", but actually we will be having the file in filesystem as /usr/lib/libc.a. This is the reason initially i=20 didn't use solib_bfd_open. But i experimented some more and tried to see how gdb behaves if we pass=20 modified pathname exactly as the file which we are having in the machine,=20 like "/usr/lib/libc.a". Then bfd bfd_check_format is failing with the error "not in executable=20 format". Looks like bfd isn't able to recognise the .a archives. I can have a look on why bfd check is failing. Please let me know if this is the right way to move forward or you have=20 any suggestions. Thanks, -Sangamesh From: "Ulrich Weigand" To: Sangamesh Mallayya/India/IBM@IBMIN Cc: gdb-patches@sourceware.org Date: 09/29/2016 08:52 PM Subject: Re: set sysroot command on AIX has no effect. Sangamesh Mallaya wrote: > set sysroot command on AIX has no effect if a program depends on shared > library archives (.a). Yes, that seems a bug. > + /* If gdb_sysroot is set via set sysroot command,=20 > + then we need to prefix gdb_sysroot to shared library path */ > + /* .a shared library archives case */ > + if (gdb_sysroot !=3D NULL && *gdb_sysroot !=3D 0) { > + sys_path =3D alloca (sizeof(gdb_sysroot)+strlen(pathname));=20 > + memset (sys_path, 0, sizeof(sys_path)); > + strcpy(sys_path, gdb_sysroot); > + pathname =3D strcat (sys_path, pathname); > + } > + path_len =3D strlen (pathname); This duplicates some of the logic in solib_find. It would be better to avoid that duplication ... Is there any reason why you cannot use solib_find / solib_bfd_fopen to open the archive file, like solib_bfd_open does? This would ensure we're always using the same search logic for .a files as for .so files. Bye, Ulrich --=20 Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com