From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13117 invoked by alias); 20 Mar 2013 17:45:09 -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 13073 invoked by uid 89); 20 Mar 2013 17:45:01 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.1 Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 20 Mar 2013 17:44:58 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MJY00200ZXSX400@a-mtaout22.012.net.il> for gdb@sourceware.org; Wed, 20 Mar 2013 19:44:49 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MJY002B4ZYOQU50@a-mtaout22.012.net.il> for gdb@sourceware.org; Wed, 20 Mar 2013 19:44:49 +0200 (IST) Date: Wed, 20 Mar 2013 17:45:00 -0000 From: Eli Zaretskii Subject: Strange backtrace from GDB 7.5.91 To: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83ppyuynhd.fsf@gnu.org> X-SW-Source: 2013-03/txt/msg00048.txt.bz2 I saw today a very strange backtrace, while debugging with GDB 7.5.91, which I got by stepping through relocate_gdb_directory: (top-gdb) s relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb", progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe") at main.c:124 124 dir = relocate_path (gdb_program_name, initial, flag); (top-gdb) bt #0 relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb", progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe") at main.c:124 #1 relocate_gdb_directory ( initial=initial@entry=0x71a51b "d:/usr/share/gdb", flag=flag@entry=1) at main.c:124 #2 0x004f0b1d in captured_main (data=data@entry=0x572ff10) at main.c:399 But relocate_path's argument list is this: relocate_path (const char *progname, const char *initial, int flag) i.e., the FLAG argument is the last one, not the first one. After one more "step", relocate_path appears twice in the backtrace, once with correct order of arguments, the other one with an incorrect order: (top-gdb) s relocate_path (initial=0x71a51b "d:/usr/share/gdb", progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe", flag=) at main.c:109 109 return make_relative_prefix (progname, BINDIR, initial); (top-gdb) bt #0 relocate_path (initial=0x71a51b "d:/usr/share/gdb", progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe", flag=) at main.c:109 #1 relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb", progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe") at main.c:120 #2 relocate_gdb_directory ( initial=initial@entry=0x71a51b "d:/usr/share/gdb", flag=flag@entry=1) at main.c:124 #3 0x004f0b1d in captured_main (data=data@entry=0x572ff10) at main.c:399 Is this due to inlining or something? Is this a bug? The compiler was GCC 4.7.2, if that matters, and the compilation switches were "-g3 -O2". MinGW GCC produced DWARF-2 debug info.