From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24621 invoked by alias); 22 Apr 2016 05:25:45 -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 24496 invoked by uid 89); 22 Apr 2016 05:25:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=1.4 required=5.0 tests=BAYES_00,BODY_8BITS,FREEMAIL_FROM,GARBLED_BODY,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy==d0=ba=d1, vital, dear, Dear?= X-HELO: mail-wm0-f66.google.com Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 22 Apr 2016 05:25:28 +0000 Received: by mail-wm0-f66.google.com with SMTP id n3so1485731wmn.1 for ; Thu, 21 Apr 2016 22:25:28 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=T64jHnoj1neRqssndpxo7C9DY8YUusypjxHhClxxjJc=; b=HLBxFL16JjiKS+V+Xd4wj5dwHxVBAzoYscWru7HzPuEaAWEI45GjGxEdovdZvaQVIC rumlxsrdwIhhpdpoGJiWtATyGTOTp5trCFe/UifSfVYBVF/jH3imyjKDB6fzc9C6XO/n YB26w9RxWIszh2VFhZQ6C4Qx9n10QFiRPwVL9K83RH+R7TU3EUSx4Vbt0eKkv5euZ65S CikDAWrTutBORxq/BeqBFrKIszIpe4eN/RjaZbwPNAOQlEwhp85v0jveB1xHFhOG/U4H /MMkd+HGW0v4EaYfQ2OEuOfpj2xQnGBd28DyOkNGgvAunxzieIvzdmvc3T46iR+VVv4U gKEA== X-Gm-Message-State: AOPr4FWfNTiFvllRBm6WOzqYtStovpWbJRnKgXEq19JHZY5v3fbJBP5YxRAhend3oYpTGpgZ++zwgP3Bce3nIQ== MIME-Version: 1.0 X-Received: by 10.194.223.70 with SMTP id qs6mr17796327wjc.119.1461302725925; Thu, 21 Apr 2016 22:25:25 -0700 (PDT) Received: by 10.194.164.233 with HTTP; Thu, 21 Apr 2016 22:25:25 -0700 (PDT) In-Reply-To: References: Date: Fri, 22 Apr 2016 05:25:00 -0000 Message-ID: Subject: Re: Minimal core dump mapping set From: vijay nag To: =?UTF-8?B?0JrRg9C60YPRiNC60LjQvSDQn9Cw0LLQtdC7INCT0LXQvdC90LDQtNGM0LXQstC40Yc=?= Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00048.txt.bz2 On Wed, Apr 20, 2016 at 10:29 PM, =D0=9A=D1=83=D0=BA=D1=83=D1=88=D0=BA=D0= =B8=D0=BD =D0=9F=D0=B0=D0=B2=D0=B5=D0=BB =D0=93=D0=B5=D0=BD=D0=BD=D0=B0=D0= =B4=D1=8C=D0=B5=D0=B2=D0=B8=D1=87 wrote: > Dear developers, > > I want to generate core dump file by application itself. Of course it sup= posed to be compatible with gdb. When I store all anonymous mappings to the= file I get no problems. I can see stacks and heaps and so forth. But I wan= t to store only stacks without heap. So I decided to skip anonymous mapping= s. Here I get in trouble. Gdb can't open that kind of core. I noticed that = storing last 4 anonymous mappings (I mean in proc maps list) solves the pr= oblem. But how can I be sure that and if the particular mapping is vital f= or gdb. And what do those mappings keep. > > Thank you for answer, > Pavel Kukushkin, > kukp@1c.ru > > > If you are looking for only stacktrace, you don't have to bother about including anonymous mappings of your task. You simply have to dump the stack pages from the current stack-top ($esp or $rsp) till the stack bottom(stack bottom can be the first variable in the main function) in your signal handler if stack pages aren't corrupted(Use madvise or msync to know the sanity of a page). Along with stack pages, you'll need register contents especially ($eip/$rip) for stack crawling. With this data, you can teach GDB to load the stack trace from your core by writing a BFD backend.