From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id C8798386186A for ; Thu, 28 Jan 2021 09:19:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C8798386186A Received: by mail-pg1-x529.google.com with SMTP id v19so3871228pgj.12 for ; Thu, 28 Jan 2021 01:19:49 -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=sIQ7hqL4wAbn1f+zurNLuP/Y2kqFH8MnX2wFL38KAIc=; b=n4uNjlj5eQ4GAvVZqkm6xKVt7F7MctfMBAN4sasR9dcCeMUHkjJKLKkGBMrUeYKpXb +YxQX3nmG12dgtxv3hxCzZ2D5obYYTGBB7PJws5RJxMa6TOUYKuKmgAL7XxZZshMVJzB h2E8XhjREAcI1bXk45t9069889z3RZtWpPHNyCcsWYtvePnqrDgywqxoGcWGLaMs+nIz ba4w81ugo+y+LMUPD/G0Nc+bixcvbJrmY2Xk9m1eK1EsnvT+FJrcXl6vGFYbvYFQiKxh lrAN3NVu3DGJn/RE0HMJ1minonxIzU+OAcFIsp7iyI0t8GUoUCa5ugVx3fNrFZWKlkEG 6MgA== X-Gm-Message-State: AOAM533X3R01AStyffrE5FmRYNfT5L8gfeKLHpXZFaRnaVpZWgSHdIJ9 c2rm7FOX2X2cAw6ZfbFh9L4B6oPmXLNma9LJR1WSvZpWbzm0ww== X-Google-Smtp-Source: ABdhPJyG3GC3wvkbv4GbwhAt0u6hf/PL0/4N8568ihVFwZRlJ2uIzBK/FqQ/M/kv3oKyqXFJEtzO+YOL1HiiGHaqERg= X-Received: by 2002:a62:5c43:0:b029:1bb:9418:b59b with SMTP id q64-20020a625c430000b02901bb9418b59bmr14693976pfb.35.1611825588995; Thu, 28 Jan 2021 01:19:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Stefan Puiu Date: Thu, 28 Jan 2021 11:19:37 +0200 Message-ID: Subject: Re: How to display instructions around the current instuction? To: Peng Yu Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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 09:19:51 -0000 Hi, On Thu, Jan 28, 2021 at 1:31 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)? > > display/10i $rip Have you tried something using '$rip-10' in your command? display/10i $rip-10 I don't think x86-64 instructions have fixed width, so that won't always print the same number of instructions before the current one, but it's probably a good approximation.