From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cLgXC7mBEmDLaAAAWB0awg (envelope-from ) for ; Thu, 28 Jan 2021 04:19:53 -0500 Received: by simark.ca (Postfix, from userid 112) id 20FA71EF80; Thu, 28 Jan 2021 04:19:53 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C206C1E590 for ; Thu, 28 Jan 2021 04:19:52 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 435E6385781B; Thu, 28 Jan 2021 09:19:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 435E6385781B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611825592; bh=sIQ7hqL4wAbn1f+zurNLuP/Y2kqFH8MnX2wFL38KAIc=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Rmpy3FlE3S0kxr31iUnruJvWplGE5yyD7nKMF9z5wO3j+cJhmZamG4jehadBSoE+3 HwKYHu335YMG1H+687kDQWsxTBo+sYJqE7UIZJiNu7AWHHDvoXT8Ds4btI8CmiuXWA CIo1LF/CnLWIaB9a8KpIP+ogs1Pzcuj3whwpzHtg= 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: Date: Thu, 28 Jan 2021 11:19:37 +0200 Message-ID: Subject: Re: How to display instructions around the current instuction? To: Peng Yu Content-Type: text/plain; charset="UTF-8" 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: , From: Stefan Puiu via Gdb Reply-To: Stefan Puiu Cc: gdb@sourceware.org Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" 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.