From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10890 invoked by alias); 25 Mar 2015 00:00:10 -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 10226 invoked by uid 89); 25 Mar 2015 00:00:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail-oi0-f48.google.com Received: from mail-oi0-f48.google.com (HELO mail-oi0-f48.google.com) (209.85.218.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 25 Mar 2015 00:00:09 +0000 Received: by oigv203 with SMTP id v203so8097007oig.3 for ; Tue, 24 Mar 2015 17:00:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=qAxXdeL80MjLVgh7hwQ3ylpyWOC5ZJqhkWg33zjkNfM=; b=gt8NBjwXBQtssQvrL9fprU3sEQ2435l8jdhi3LDWIt4leyKAaa9J0CKhcpBdOzyYnP aWIhNLFYMd8/aEdSXtLYvsjV5SlY/jVMEpjHrw5Fok0RyM42bQ4reFixyhskxqIKx52+ 24BrQydiUhKvYypNN4c3ZNz8a2xj+JlZcWxA0UU6gODYV+haOBdMT74pwaDhfb9UBPA8 vf7ZJBGKsM17FByj+kTSlshQD/zbWI0sX21EEKZP7S0LUiMLwcHQ+/TzUGKPOn3ttYOz zCVYTy8KgGUP3AjlftBDmtK1LSSgxx84reNjg7egVQMO5c4wqitUq3GwUsfgr5Aa0e74 pkHA== X-Gm-Message-State: ALoCoQlFSX8I2sJGY8oiNHKNm1lYyNY/AdHvvaTHM05HjiAat9z8q2Buu4w8nYOrA7ka6Ym+Likk MIME-Version: 1.0 X-Received: by 10.60.77.38 with SMTP id p6mr836711oew.75.1427241607303; Tue, 24 Mar 2015 17:00:07 -0700 (PDT) Received: by 10.182.142.226 with HTTP; Tue, 24 Mar 2015 17:00:07 -0700 (PDT) Date: Wed, 25 Mar 2015 00:00:00 -0000 Message-ID: Subject: Unwinding through multiple stacks From: Doug Evans To: Andy Wingo Cc: Alexander Smundak , gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00819.txt.bz2 Hi. A topic came up on #gdb that the current patches don't cover. What if the frame we're trying to unwind through has a different stack? If the different stack is below the "normal" stack gdb will complain: Backtrace stopped: previous frame inner to this frame (corrupt stack?) The code to catch this is in frame.c: /* Check that this frame's ID isn't inner to (younger, below, next) the next frame. This happens when a frame unwind goes backwards. This check is valid only if this frame and the next frame are NORMAL. See the comment at frame_id_inner for details. */ if (get_frame_type (this_frame) == NORMAL_FRAME && this_frame->next->unwind->type == NORMAL_FRAME && frame_id_inner (get_frame_arch (this_frame->next), get_frame_id (this_frame), get_frame_id (this_frame->next))) { CORE_ADDR this_pc_in_block; struct minimal_symbol *morestack_msym; const char *morestack_name = NULL; /* gcc -fsplit-stack __morestack can continue the stack anywhere. */ this_pc_in_block = get_frame_address_in_block (this_frame); morestack_msym = lookup_minimal_symbol_by_pc (this_pc_in_block).minsym; if (morestack_msym) morestack_name = MSYMBOL_LINKAGE_NAME (morestack_msym); if (!morestack_name || strcmp (morestack_name, "__morestack") != 0) { if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "-> "); fprint_frame (gdb_stdlog, NULL); fprintf_unfiltered (gdb_stdlog, " // this frame ID is inner }\n"); } this_frame->stop_reason = UNWIND_INNER_ID; return NULL; } } We need to generalize the __morestack solution and provide it through the unwinders.