From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125160 invoked by alias); 4 Jan 2020 12:07:55 -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 125151 invoked by uid 89); 4 Jan 2020 12:07:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=HX-Spam-Relays-External:209.85.128.66, H*RU:209.85.128.66, H*RU:gmail.com, HX-Spam-Relays-External:gmail.com X-HELO: mail-wm1-f66.google.com Received: from mail-wm1-f66.google.com (HELO mail-wm1-f66.google.com) (209.85.128.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 04 Jan 2020 12:07:54 +0000 Received: by mail-wm1-f66.google.com with SMTP id c127so8608619wme.1 for ; Sat, 04 Jan 2020 04:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-description :content-disposition; bh=0HCPPJuGzoIXe7F2FGIVUPGDX92Bp+UHWj1Ej1uL1VA=; b=WrPqWao4JRqDnrcQRtHR6aoTkvxu5kc/rW+CObNvU+V+zYHUOukggJjxsE6saP/G5b tBba7MRQLKR8q51knAaxMIgwcFqNhMzUJBQilkVukPRNwtVn/AVI76FkH+iqD/hniCwe BlSsaGb3bc/Q7lwyw5g3stNvHzqm8yx0o0hXm85sWgDM0H7naX+346WB0+xBmCUjYaeI SnrN1ZxVYXToBDvbw/Q1n/nHcyGujUzoBNx4nk8up14SeL1T+HhmlxLu4wDN2xbe8EvY F/SVaub5CNSTYIz8YTsJXia7LEIcqEpZpU78LGMypLTilSGvUikCI+Zrnisj9R1hYmUM Es0g== Return-Path: Received: from gmail.com ([2a03:1b20:3:f011::6d]) by smtp.gmail.com with ESMTPSA id m7sm15437265wma.39.2020.01.04.04.07.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jan 2020 04:07:51 -0800 (PST) Date: Sat, 04 Jan 2020 12:07:00 -0000 From: Shahab Vahedi To: gdb@sourceware.org Subject: Getting rid of "Cannot access memory at address ..." Message-ID: <20200104120749.GA166189@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Description: quest Content-Disposition: inline X-SW-Source: 2020-01/txt/msg00002.txt.bz2 Hello everyone, I have sumbitted a bug [1]. I am not going to repeat the whole description here but only the part pertaining to the solution. To solve the whole bug completely, there are 2 things to tackle: 1. The overflow occuring in "tui_disasm_window::addr_is_displayed". A patch has been submitted [2]. 2. Calculation of "max_lines" in "tui_disasm_window::set_contents". Ideally, "max_lines" should be: max_lines = std::min(height-2, number_of_instructions_in_elf); However, it's not trivial (to me) how to get the number of instructions that exist there. Any thought on that? -- Shahab [1] https://sourceware.org/bugzilla/show_bug.cgi?id=25345 [2] with title: [PATCH] GDB: Fix the overflow in addr_is_displayed()