Return-Path: X-Original-To: apmail-hawq-dev-archive@minotaur.apache.org Delivered-To: apmail-hawq-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D12018C12 for ; Fri, 20 Nov 2015 03:21:48 +0000 (UTC) Received: (qmail 60635 invoked by uid 500); 20 Nov 2015 03:21:43 -0000 Delivered-To: apmail-hawq-dev-archive@hawq.apache.org Received: (qmail 60576 invoked by uid 500); 20 Nov 2015 03:21:43 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 60553 invoked by uid 99); 20 Nov 2015 03:21:42 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Nov 2015 03:21:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2F02C180A2A for ; Fri, 20 Nov 2015 03:21:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.98 X-Spam-Level: ** X-Spam-Status: No, score=2.98 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=vitessedata-com.20150623.gappssmtp.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id obTiqgY66p_s for ; Fri, 20 Nov 2015 03:21:40 +0000 (UTC) Received: from mail-yk0-f170.google.com (mail-yk0-f170.google.com [209.85.160.170]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 9B67442AEE for ; Fri, 20 Nov 2015 03:21:40 +0000 (UTC) Received: by ykdr82 with SMTP id r82so141267889ykd.3 for ; Thu, 19 Nov 2015 19:21:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vitessedata-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ZJgZPU1k6vyMnfErkTKyHREU94LWsjHhyfg8rbJO0gU=; b=cDUt969wVxpHRxhXmKxRd939WeO9qrS3PSVaQ6kWqUCck5v+mW78ySLTg0nooJqytP bybS+wG5ehg6RnxcufE/KSpikkPgHltTuWfzomc8G231rhKuN9BZyH1LIIg6tKK0wfcE rN9qvRaM4ycICEbkABfpO8ngUi7EdY0YcHiMecX8FAboaAFZ+IGWMMq1L7wTfmiCAuD6 DxzjbjRA0+RAQZ6/Fd/ZwAF1ew7FV0JF+C9fBd+ZGO/fwShCMYd26LttFmq3xMEt9Mwz LPZrFF3033d8cC3fd4HBBcTCACr6t0ioXJGnUcFCbC7JFrXjoCWkeIZTYuKKL3WSg6I/ 3evA== 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:content-type; bh=ZJgZPU1k6vyMnfErkTKyHREU94LWsjHhyfg8rbJO0gU=; b=JQaofoarruF1/QrK0qxasRkA8ZfqXBlbQcXZGSYUjVCEegzv/yC8lqQlESVGn3q2HU 34FaJMuZt2skwLZ8DIWDBXtsOv6mPgneqlMbGgZPtcwOcRugo2GKQecWZ8HQ6oULxJeQ 9sQnP1cHT3gT9q+3JF2OmFQaH6rgzDoP9Q24+eqdB7Wrq7ROJuB23LNQGleARXoDcMxk ixq2jvGOyzy7AWaYb/HOd830t8YPTnkGLLVHSS2V8dABTMJGaqMT/HrOxOPWFJ4iR9xq h+uRJhJ7UrJ0U8iZBX2hscv4q9BTisMh7Stn6ATxX3EA6AiEQqtVQCoCgKhFLxOZpOZR kO9g== X-Gm-Message-State: ALoCoQllS7VmdxGP70LRcCng/k4+sarYoWTJhq40yHyaLzJQYXi6ED8NtSV3zew1hCEfJBhc4YX3 MIME-Version: 1.0 X-Received: by 10.13.197.194 with SMTP id h185mr10519839ywd.12.1447989700283; Thu, 19 Nov 2015 19:21:40 -0800 (PST) Received: by 10.31.47.22 with HTTP; Thu, 19 Nov 2015 19:21:40 -0800 (PST) In-Reply-To: <149d1bd9.7d8b.150db306b47.Coremail.hawqstudy@163.com> References: <149d1bd9.7d8b.150db306b47.Coremail.hawqstudy@163.com> Date: Thu, 19 Nov 2015 19:21:40 -0800 Message-ID: Subject: Re: how to set breakpoint for hawq From: Feng Tian To: dev@hawq.incubator.apache.org Content-Type: multipart/alternative; boundary=001a114edd4ab983780524f05f41 --001a114edd4ab983780524f05f41 Content-Type: text/plain; charset=UTF-8 Take a look at debugbreak.h and debugbreak.c enable USE_DEBUG_BREAK in configure, and if you want to, you can make debug_break_n_flags a GUC. Modern (or better?) approach is to use systemtap, fire up a debugger when something triggers. Sorry, I left all my systemtap scripts with my previous employer. On Thu, Nov 5, 2015 at 9:06 PM, hawqstudy wrote: > Hi guys, > > > I'm trying to set breakpoint in gdb but found it's difficult to follow the > codepath into child processes. > > > For example, if I want to see the calling path for > get_datanode_rest_servers ( which calls getNodesInfo to request hdfs node > information ), I do: > (gdb) break get_datanode_rest_servers > Breakpoint 4 at 0x5143b0 > (gdb) c > Continuing. > [New Thread 0x7f4fd0d2c700 (LWP 20508)] > [Thread 0x7f4fd0d2c700 (LWP 20508) exited] > [New Thread 0x7f4fd0d2c700 (LWP 20511)] > [Thread 0x7f4fd0d2c700 (LWP 20511) exited] > Detaching after fork from child process 20515. > > > It doesn't seems work because I guess the function is called within child > process. > However if I set follow-fork-mode child, gdb will quit after following the > first forked process: > (gdb) set follow-fork-mode child > (gdb) c > Continuing. > [New Thread 0x7f4fd0d2c700 (LWP 20521)] > [Thread 0x7f4fd0d2c700 (LWP 20521) exited] > [New Thread 0x7f4fd0d2c700 (LWP 20524)] > [Thread 0x7f4fd0d2c700 (LWP 20524) exited] > [New process 20528] > [Thread debugging using libthread_db enabled] > process 20528 is executing new program: /bin/bash > Error in re-setting breakpoint 4: Function "get_datanode_rest_servers" not > defined. > process 20528 is executing new program: /usr/bin/addr2line > Missing separate debuginfos, use: debuginfo-install > bash-4.1.2-9.el6_2.x86_64 > > > Program exited normally. > Missing separate debuginfos, use: debuginfo-install > binutils-2.20.51.0.2-5.34.el6.x86_64 > > > It calls addr2line when trying to get stack trace for writting logs, and > gdb just quit program when addr2line finish. > I think there must be some easier way to track into child processes when > debugging hawq, please give some advice. > Cheers --001a114edd4ab983780524f05f41--