From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by sourceware.org (Postfix) with ESMTPS id BD54F3857004 for ; Thu, 28 Jan 2021 13:11:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BD54F3857004 Received: by mail-qt1-x830.google.com with SMTP id t17so3986021qtq.2 for ; Thu, 28 Jan 2021 05:11:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aSsj3A33mQAkq2yRnQmrHYTcN1ERh6vhBNrWX/wSyPk=; b=mQA1vR9uGZoGdyeCfYkbbUCFLa92AILBeifPIUO2G1GuH7pXBJXfmimP6xk31tlzKI SXg3+ZO+zo8WT1INEpgUjzavPgZ8QJS5KHk6MEArmHqaTWFiowfHoD5Ojk/aVuWOHUaF m6ZkcBxsRE6iuKz/ut8MTnTKPBGGd+/Pl5JhgDkJk/T07/YvLC6EurRseAD56m3JPoND /hm3Y9Ox58wYjUb1YJaaiEyGwIUASuFnZTyJt9S4+mMRzuB6P2Re8r7WCzvAU1EKVkRE YjAfJMgCAxzatG9RFzB+4ruJavZSwq5EMerAkf1wBo2Uvh1A5+3oOHizOhwy39MUhVQo WpsA== X-Gm-Message-State: AOAM532DG2oYph39vltsSl8nAuLS1Q2TX6Vv0+jst1TFsd5dfJR1Onnu TlTPl3lVu4Ibo8fveFMxMecbc+sTuP2MMGWaaPzN6z/y91hdzBLohaE= X-Google-Smtp-Source: ABdhPJxTb2yOlqzooCKsPyqtva2NcdmqA61t50P5J6YUehjMkhfVTvWw4Q4fLDcGoMrJbL8+5hKaD5q4aIIILFrpn2k= X-Received: by 2002:aed:3949:: with SMTP id l67mr14342934qte.322.1611839505160; Thu, 28 Jan 2021 05:11:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Christian Biesinger Date: Thu, 28 Jan 2021 14:11:07 +0100 Message-ID: Subject: Re: How to display instructions around the current instuction? To: Peng Yu Cc: Reuben Thomas via Gdb Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-19.9 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2021 13:11:47 -0000 On Thu, Jan 28, 2021 at 12:13 AM Peng Yu via Gdb wrote: > > Hi, > > The following command will disply instructions below the current > instructions. Is there a way to display around the current instruction > (e.g., 5 instructions above and 5 instructions below)? I believe "disas" should work: Breakpoint 1, main () at a.cpp:5 5 std::cout << "Miau\n"; (gdb) disas Dump of assembler code for function main(): 0x0000555555555155 <+0>: push %rbp 0x0000555555555156 <+1>: mov %rsp,%rbp => 0x0000555555555159 <+4>: lea 0xea5(%rip),%rsi # 0x555555556005 0x0000555555555160 <+11>: lea 0x2ed9(%rip),%rdi # 0x555555558040 <_ZSt4cout@GLIBCXX_3.4> 0x0000555555555167 <+18>: call 0x555555555040 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt> 0x000055555555516c <+23>: mov $0x0,%eax 0x0000555555555171 <+28>: pop %rbp 0x0000555555555172 <+29>: ret End of assembler dump.