From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32318 invoked by alias); 9 Oct 2011 21:36:35 -0000 Received: (qmail 32310 invoked by uid 22791); 9 Oct 2011 21:36:34 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Oct 2011 21:36:19 +0000 Received: from hpaq11.eem.corp.google.com (hpaq11.eem.corp.google.com [172.25.149.11]) by smtp-out.google.com with ESMTP id p99LaIDB001461 for ; Sun, 9 Oct 2011 14:36:18 -0700 Received: from qap1 (qap1.prod.google.com [10.224.4.1]) by hpaq11.eem.corp.google.com with ESMTP id p99LZZdJ015227 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sun, 9 Oct 2011 14:36:17 -0700 Received: by qap1 with SMTP id 1so10136676qap.4 for ; Sun, 09 Oct 2011 14:36:16 -0700 (PDT) Received: by 10.224.194.130 with SMTP id dy2mr8847854qab.94.1318196176769; Sun, 09 Oct 2011 14:36:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.194.130 with SMTP id dy2mr8847848qab.94.1318196176636; Sun, 09 Oct 2011 14:36:16 -0700 (PDT) Received: by 10.224.80.149 with HTTP; Sun, 9 Oct 2011 14:36:16 -0700 (PDT) Date: Sun, 09 Oct 2011 21:36:00 -0000 Message-ID: Subject: attach u/i oddity From: Doug Evans To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2011-10/txt/msg00045.txt.bz2 I know why this happens, but as a user it's not intuitive: if gdb could figure out the program (and arch) the first time, why can't it the second time? bash$ gdb (gdb) attach 1234 # a 32 bit program: forever.x32 (gdb) detach (gdb) attach 1235 # a 64 bit program: forever.x64 --> Attaching to program: /home/dje/src/play/forever.x32, process 31621 warning: Selected architecture i386 is not compatible with reported target architecture i386:x86-64 warning: Architecture rejected target-supplied description Reading symbols from /usr/grte/v2/lib/ld-linux.so.2...(no debugging symbols found)...done. Loaded symbols for /usr/grte/v2/lib/ld-linux.so.2 0x46403fe0 in ?? () (gdb) The user never specified forever.x32 as the program to debug, gdb was being clever. However, if it's going to be clever the first time, it's a bug (from the user's perspective) to not be clever the second time too (IMO). Comments?