From patchwork Sat Dec 31 08:48:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 65646 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F850385482E for ; Sat, 25 Feb 2023 10:02:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F850385482E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677319370; bh=7GKuiy01AFz4sAgZUPeEedwakd/1LpHEy44t7YrSpuU=; h=Resent-From:Resent-Date:Resent-To:In-Reply-To:References:Date: Subject:To:Cc:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fLEgDQKAX4W9yqy4F0n7vMJZUfaeHTe7U1AMv3JkQW0OIw+03Adx8/MLcPdSSu+TB mrcEmu/ny/1UHvsHFdEfTqe6wOFrilYQaRrHJOiIFjBpMED4k8/vRtY6AAvCSBssQi 9vTGlcyXoT62TIEbZIoEbtGhqF9aEXSAqJkfl9uQ= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by sourceware.org (Postfix) with ESMTPS id 862B638515D7 for ; Sat, 25 Feb 2023 10:02:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 862B638515D7 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KPD2UiToYnZLAFQoVBFvTWfOe7xIQynEXGQkKhbb46jwIrlYWN935JOqzM6Zggtda3puak838yB/dbicIe9yDm6pzR0KGbpmGlMdPY2JMkGi20ELyz8BbwrjjlJ2hV30XzxO2LZ+7+B0UZsQ5KjNW/4dLklt0Qm5Ph7svyVnnu1RUAJJT0B4JyhchDSr4945xKfp8wnRh6zMwLiIyITIa5yrk2nFbfQ8GHHs0yCwy9jIzkiUei+t5uSnjcl4ueOAjaIWtaL3efevA5/wyP+Rbho4aiXbAIFjeOYbW65DIzJ0wGC/ZnrXOZFTfJG9FyeZlj/LtvXyGzPSo09cjwcYzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7GKuiy01AFz4sAgZUPeEedwakd/1LpHEy44t7YrSpuU=; b=IljwqPtkvF08BYeAXpTzHPBSnnzdL6mL8ji1r2UGA4wDB+CFGtSQbEFCIhznqkq6xTt9d8L3qD436SVsrC7gL2i9mfU9zGjJNrJJUKNPwfkPoR9GuPQwl2ggOKrtyuH2u3ml9rnFDU+cBqOiU2Oc1ZZimeOVmQHUhic3S7Y1fZ7ciUA8VTBjKkvX19CLm6EmWfm/Kx31OJ4rajJJBSZmqjhX3NO9a0Uf1Ej8wAfAITu+dPdawxmuFGWCYXjQbDAXSvFxRawErlIfzXAjTweYn2D3iideaYq8o5+sXLQSfNgHYzhej6T/Of34DdO8Rb97uttMf5IZwytOnIiPP+7a6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=azul.com; dmarc=pass action=none header.from=azul.com; dkim=pass header.d=azul.com; arc=none Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM4PR11MB6381.namprd11.prod.outlook.com (2603:10b6:8:bd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19; Sat, 25 Feb 2023 10:02:18 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::8476:1cf6:afeb:c285]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::8476:1cf6:afeb:c285%7]) with mapi id 15.20.6134.021; Sat, 25 Feb 2023 10:02:18 +0000 Resent-From: Jan Kratochvil Resent-Date: Sat, 25 Feb 2023 18:02:10 +0800 Resent-Message-ID: Resent-To: luis.machado@arm.com, gdb-patches@sourceware.org In-Reply-To: <02d34e87-a8a6-4038-1e97-bb821707d308@arm.com> References: <02d34e87-a8a6-4038-1e97-bb821707d308@arm.com> Date: Sat, 31 Dec 2022 16:48:09 +0800 Subject: [PATCH v4] gdb/arm: Fix backtrace for pthread_cond_timedwait To: gdb-patches@sourceware.org Cc: Luis Machado X-ClientProxiedBy: VI1PR0102CA0066.eurprd01.prod.exchangelabs.com (2603:10a6:803::43) To DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) Message-ID: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR11MB4073:EE_|DM4PR11MB6381:EE_ X-MS-Office365-Filtering-Correlation-Id: c36c7036-a23b-4b7b-4263-08db171760fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fqJH72jVa3D/7ttMcSuBsMleOVPG9ZiyDPYgKm0Mv0imfI+NBtaJppPmsruniUYyafqrYU1GSMWXMJvS6gtBmyjzs0iLCQ6s23W4vt+fH9xdenyFRsl1En4nabGQeundJDxPWd6ytgPEtLQ+A3D9kGJ8N3UMJNjbqXA8KPB1AOucVJCREL/jD7mSrRGd+DLNIr7BlhDNS/8geizRheJQWuE7RbLo+Faaf02jpErp0uG7meGalzOmj4/Bv2/WFIdcVx66B7cUe5gNWpokNaphRAMnLmfEgAaqXI/lQE6f4JFgEjhBPcUSMT730YpWrINRDCQEMzgFdoYhCpKR+l/KFKjPrlIjJi5QKxxxIy6gJ94G79f1HXfamXcLDQY1QsWdJWYIuyD1UycECzEQiI7s/jU99bhLLSfJOe6+f/7ofUDol7PnjCrAibjSZ7Lf3CIAJeIotHvsHAaCOcWPSz3SNYrdD7Wsi71KyaUsblFvXqcbHDNdzmK7Kvn7Lzq/7elRfI01VZydYWS5pu0HtEtqxVDak3qDa2I5/X0iJQCEUL4UGOVGZKzSRJEuL6M2bLC5vyUoLKXTDaP/a5DTLAZZejTu2iVvkUxcRJqAm/4fQMxJPObNeHl1v1StzZhheZMGuDU1AvbusOT2VFB3MYD9aJHoPUkoKa1uksTUmrrQ+RA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4073.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(376002)(366004)(396003)(136003)(39850400004)(451199018)(5660300002)(478600001)(83380400001)(2906002)(9686003)(86362001)(41300700001)(6666004)(52536014)(33656002)(4326008)(7696005)(6916009)(38100700002)(6506007)(316002)(186003)(8676002)(66556008)(66946007)(8936002)(66476007)(55016003)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Og8dLJftKoiF1IOjtYc+FT9ZtVJ1JRhAcM+ylThAt8rUUQda1bmgo+AkhlGtfyG/ydgAn+mzkNPPF8jz5SWMGu07f3ZFCd9+Ro9gEEHsh4d6nLVihn9WgYAXUh9yD1vwaNYEI7YUVZkTaeF/rpydge/AoF+DBKwC8B5ObJ9WLM6heY8FVvW94+P/e4NgyR6CCi9ByX6gV06hg5i3rZNEeA6lKDlr9HHwBlGX6Ysq0HaVvTMwtGdVU0m1R4pGFOF4z1zIpBw/+U8OgdbJl0qrCb8RmNL7wBAMwymTBHXRFR5IsJzMV4xT/w1ppN/bEdmIjTZShUgp0o9JRgydYuJzrqdqS4TkiJQppfm46m3hm1LSmgVI2k+nqj3Hu5FZ3SfGY8xuIQENZiq53v2Q2cJ1rbwzxOE5CupAyDDNAAVYvGoM1jz0wpPALUMuQNnrqNd/iNH7cgZQb+BJdquiu4iui0qPI7tkfXfhQ8cOcE/VDj9us9+NU1PZqUvvhGcTCnOeQxk5c2MOh8WMDqFmeMdNRZDRzpEAlVV7UzlOEXcaYDtI+51MwRdVNDiFGZLQsrTlB8nKq0VqmzR7ChAQINJdqIM8FM0mZfTmdKB2lASO0UWd2/0+4dWVwbFAIlkumy0bnnVORYSvHKnc5xHAZ+yQkQnekAByX8Lz+Ql9E2Kasdwc/7bJVckbpEyL0YrjKLkf0VE5o7eGQhLhf3eNQTcg9kxM1f1NDDIhrSEh5mDlyaXYrpB6clUwDE6wQAODDx05HXjGiRfU9C5WvUGawn9sbyEh61fKcvCg0aRXPDAUxa7YPZ79JU+dsXOr5t27i+gB8NNQmFT3hmK+QMJTjJJlMOVxk5XkXRzGyoX3qTCeUFUlEwAp6v+8ApKMiG2cuAxWlK9JfbLuOJ6KC/FikAbztY9eKRpks/svsK6Cu01VXcxISOIRrC9gxbeTqH5qDGbIoZK2U8BVGdiTbqFlAzVV2QbaNK5VTk56wF54Avrkx+f2/V6+CpREeUzVo1lJP1HHeaglwidGKAoQcUEMhIsar9R0+KY9bESSDalaFIRW8EIWHpstjrYeb5HF0DMyZW1WIkzgV68FqWa5tak126zzQXKufCAxI+znLqJKtYJj8WvtTPsL4lfsbsxi61QvA8rfmze7q5WAc5iORvFl5yHkc6vArS6Pj8iE5OgQZ2jMLCDet2xPgT2fO8YN/JUINtl97vBvVBqq7Gz3R8va5p5kS2rkpzp4YrJsA3WfOROK14asskCaH+kzI2DOhA1CwKjAGsB6DgaW6dUcEAKF03YKkEb1F8N5ERud83XViDNX4T9Qw0dVQf9ZgpLGjFN70LjWZeugPGvRa1yaiu8aiew0IsQBBo4BC2YX0FaEmsFa2VGvnyP3YyINqvX6sxB8JWJmLiyjO/mv3n2opv6UThoGApc6CZMn7C7jtK0pXAwn6vDW9IytA1HKLCn5C2C43gqA+kbCa1r80Q8Kr1LibaIBRY6wZ/7vln2nX46PJizBbdWuiRX+mQbSHgWHTgZSzyU43jY1ILhhxXtd1GdVV12LAFLFBXiZEOysxQ8TC+FWC4+NjocDue6OGEkF+XTkSWdFqua+fBs9xb6AbVu7gLUXSQ== X-OriginatorOrg: azul.com X-MS-Exchange-CrossTenant-Network-Message-Id: c36c7036-a23b-4b7b-4263-08db171760fa X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2023 10:02:18.4257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c480eb31-2b17-43d7-b4c7-9bcb20cc4bf2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ueDA88F981LOcqln0d1W6VfDETkorBOCkLl+HgAYtnFdLs1Ou4qdc4z8y5bJMt8/M+nC4s2dsLmHgAXk5rypVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6381 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Kratochvil via Gdb-patches From: Jan Kratochvil Reply-To: Jan Kratochvil Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" GDB expected PC should point right after the SVC instruction when the syscall is active. But some active syscalls keep PC pointing to the SVC instruction itself. This leads to a broken backtrace like: Backtrace stopped: previous frame identical to this frame (corrupt stack?) #0 0xb6f8681c in pthread_cond_timedwait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0 #1 0xb6e21f80 in ?? () The reason is that .ARM.exidx unwinder gives up if PC does not point right after the SVC (syscall) instruction. I did not investigate why but some syscalls will point PC to the SVC instruction itself. This happens for the "futex" syscall used by pthread_cond_timedwait. That normally does not matter as ARM prologue unwinder gets called instead of the .ARM.exidx one. Unfortunately some glibc calls have more complicated prologue where the GDB unwinder fails to properly determine the return address (that is in fact an orthogonal GDB bug). I expect it is due to the "vpush" there in this case but I did not investigate it more: Dump of assembler code for function pthread_cond_timedwait@@GLIBC_2.4: 0xb6f8757c <+0>: push {r4, r5, r6, r7, r8, r9, r10, r11, lr} 0xb6f87580 <+4>: mov r10, r2 0xb6f87584 <+8>: vpush {d8} Regression tested on armv7l kernel 5.15.32-v7l+ (Raspbian 11). --- gdb/arm-tdep.c | 42 ++++--- .../gdb.arch/arm-pthread_cond_timedwait-bt.c | 67 ++++++++++ .../arm-pthread_cond_timedwait-bt.exp | 118 ++++++++++++++++++ 3 files changed, 210 insertions(+), 17 deletions(-) create mode 100644 gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.c create mode 100644 gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 78a2fe2ade5..328eb17f419 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3116,26 +3116,34 @@ arm_exidx_unwind_sniffer (const struct frame_unwind *self, && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME) exc_valid = 1; - /* We also assume exception information is valid if we're currently - blocked in a system call. The system library is supposed to - ensure this, so that e.g. pthread cancellation works. */ - if (arm_frame_is_thumb (this_frame)) + /* Some syscalls keep PC pointing to the SVC instruction itself. */ + for (int shift = 0; shift <= 1 && !exc_valid; ++shift) { - ULONGEST insn; + /* We also assume exception information is valid if we're currently + blocked in a system call. The system library is supposed to + ensure this, so that e.g. pthread cancellation works. */ + if (arm_frame_is_thumb (this_frame)) + { + ULONGEST insn; - if (safe_read_memory_unsigned_integer (get_frame_pc (this_frame) - 2, - 2, byte_order_for_code, &insn) - && (insn & 0xff00) == 0xdf00 /* svc */) - exc_valid = 1; - } - else - { - ULONGEST insn; + if (safe_read_memory_unsigned_integer ((get_frame_pc (this_frame) + - (shift ? 2 : 0)), + 2, byte_order_for_code, + &insn) + && (insn & 0xff00) == 0xdf00 /* svc */) + exc_valid = 1; + } + else + { + ULONGEST insn; - if (safe_read_memory_unsigned_integer (get_frame_pc (this_frame) - 4, - 4, byte_order_for_code, &insn) - && (insn & 0x0f000000) == 0x0f000000 /* svc */) - exc_valid = 1; + if (safe_read_memory_unsigned_integer ((get_frame_pc (this_frame) + - (shift ? 4 : 0)), + 4, byte_order_for_code, + &insn) + && (insn & 0x0f000000) == 0x0f000000 /* svc */) + exc_valid = 1; + } } /* Bail out if we don't know that exception information is valid. */ diff --git a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.c b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.c new file mode 100644 index 00000000000..526b5faa017 --- /dev/null +++ b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.c @@ -0,0 +1,67 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2022 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include +#include +#include + +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; + +static void *fun(void *arg) +{ + struct timeval now; + struct timespec until; + int err; + + err = gettimeofday(&now, NULL); + assert(!err); + + until.tv_sec = now.tv_sec + 60; + until.tv_nsec = now.tv_usec * 1000UL; + + pthread_cond_timedwait(&cond, &mutex, &until); + assert(0); + err = pthread_mutex_unlock(&mutex); + assert(!err); + + return arg; +} + +void breakhere() +{ +} + +int main() +{ + pthread_t thread; + void *ret; + int err; + + err = pthread_mutex_lock(&mutex); + assert(!err); + err = pthread_create(&thread, NULL, fun, NULL); + assert(!err); + err = pthread_mutex_lock(&mutex); + assert(!err); + breakhere(); + err = pthread_join(thread, &ret); + assert(0); + + return 0; +} diff --git a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp new file mode 100644 index 00000000000..f0d9c2f3e46 --- /dev/null +++ b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp @@ -0,0 +1,118 @@ +# Copyright 2022 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This serves as a template for writing new test cases. Replace this with +# a description of what this test case tests. + +standard_testfile + +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ + {debug pthreads}] } { + return +} + +# See if we have target board readnow.exp or similar. +if { [lsearch -exact $GDBFLAGS -readnow] != -1 \ + || [lsearch -exact $GDBFLAGS --readnow] != -1 } { + untested "--readnever not allowed in combination with --readnow" + return -1 +} + +save_vars { GDBFLAGS } { + append GDBFLAGS " --readnever" + if { [clean_restart ${binfile}] == -1 } { + return -1 + } +} + +if { ![runto_main] } { + return +} + +gdb_test "advance breakhere" " in breakhere .*" + +gdb_test "thread 2" "Switching to thread 2 .*" "thread 2 for svc check" + +# GDB expected PC should point right after the SVC instruction when the syscall is active. +# But some active syscalls keep PC pointing to the SVC instruction itself. +set test "pc points to svc" +gdb_test_multiple {x/i $pc} $test { + -re ":\tsvc\t(0x00000000|0)\r\n$gdb_prompt $" { + pass $test + } + -re "\r\n$gdb_prompt $" { + untested $test + return + } +} + +gdb_test "thread 1" "Switching to thread 1 .*" +gdb_test_no_output "set debug frame 1" + +# PASS: +# [frame] frame_unwind_try_unwinder: trying unwinder "arm exidx" +# [frame] frame_unwind_register_value: enter +#... +# [frame] frame_unwind_register_value: exit +# [frame] frame_unwind_try_unwinder: yes +#... +# [frame] get_prev_frame_always_1: -> {level=0,type=NORMAL_FRAME,unwinder="arm exidx",pc=0xb6f8681c,id=,func=} // cached + +# FAIL: +# [frame] frame_unwind_try_unwinder: trying unwinder "arm exidx" +# [frame] frame_unwind_register_value: enter +#... +# [frame] frame_unwind_register_value: exit +# [frame] frame_unwind_try_unwinder: no +# [frame] frame_unwind_try_unwinder: trying unwinder "arm epilogue" +# [frame] frame_unwind_register_value: enter +#... +# [frame] frame_unwind_register_value: exit +# [frame] frame_unwind_try_unwinder: no +# [frame] frame_unwind_try_unwinder: trying unwinder "arm prologue" +# [frame] frame_unwind_try_unwinder: yes +#... +# [frame] get_prev_frame_always_1: -> {level=0,type=NORMAL_FRAME,unwinder="arm prologue",pc=0xb6f8681c,id=,func=} // cached + +set test "unwinder is arm exidx" +# Switch the threads to reset frame cache. +gdb_test_multiple {thread 2} $test { + -re "\{level=0,type=NORMAL_FRAME,unwinder=\"arm exidx\",pc=.*\r\n$gdb_prompt $" { + pass $test + } + -re "\{level=0,type=NORMAL_FRAME,unwinder=\"arm prologue\",pc=.*\r\n$gdb_prompt $" { + fail $test + } + -re "\r\n$gdb_prompt $" { + untested $test + return + } +} + +gdb_test "thread 2" "Switching to thread 2 .*" "thread 2 for debug frame check" + +gdb_test_no_output "set debug frame 0" + +# PASS: +# #0 0xb6f8681c in pthread_cond_timedwait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0 +# #1 0x00010648 in fun (arg=0x0) at .../gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.c:38 +# ... + +# FAIL: +# #0 0xb6f8681c in pthread_cond_timedwait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0 +# #1 0xb6e21f80 in ?? () +# Backtrace stopped: previous frame identical to this frame (corrupt stack?) + +gdb_test "bt" { in fun \(\).*} "unwind of pthread_cond_timedwait"