From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14647 invoked by alias); 16 Jan 2015 03:48:04 -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 14532 invoked by uid 89); 16 Jan 2015 03:47:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f194.google.com Received: from mail-yk0-f194.google.com (HELO mail-yk0-f194.google.com) (209.85.160.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 16 Jan 2015 03:47:49 +0000 Received: by mail-yk0-f194.google.com with SMTP id 9so2051097ykp.1 for ; Thu, 15 Jan 2015 19:47:47 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.170.42.151 with SMTP id 145mr9232280ykk.74.1421380067227; Thu, 15 Jan 2015 19:47:47 -0800 (PST) Received: by 10.170.214.86 with HTTP; Thu, 15 Jan 2015 19:47:47 -0800 (PST) Date: Fri, 16 Jan 2015 03:48:00 -0000 Message-ID: Subject: How does GDB know the architecture of an executable? From: fei ding To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00033.txt.bz2 Hi guys: I'm wondering how does GDB know the architecture of an executable, for example, if I use -m32 options in gcc and I can get an i386 executable, if I use nothing I'll get a x86-64 executable while I am compiling code on a 64-bit Linux. I've see the source code for one day but I cannot get what I want, at first I think '''struct gdbarch''' has something with it. Can anyone help me? I want to know everything about this. Thanks a lot.