From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 8988D3858D20 for ; Tue, 7 May 2024 21:34:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8988D3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=brasko.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=brasko.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8988D3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715117655; cv=none; b=sJbsT2dKVYZGhSdZqhsdwEdHurVG6SGZ5LUZZR9Fc/c/Mt1AF/Rto6tw/kr0WolGx4W94KIqq1rzMnraS6XWuk43icvHF/5/NRFJ1UKqFUADNq4Z1GC+2y4tSm0fxIT+tGVn61eih+tvATU62q5BoajeXpUo1B/Llgl4DhWKB0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715117655; c=relaxed/simple; bh=iFKUT705K1pVT7cyD2vVkWJFTS3A9Gy2hGOmtWKhFxM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=uyKVdGpkbjzLc1khzKy5gmoCOTQEdF/g/VR5UhreiDLmmqRl2dOHQfDSE4/R+FynP1g015b6vJZFfQiXDp0BTkplwniZG4Y1bRa0sPrL3/kp6yQuJqz6xL7hhQisfkkRccWR26+ka8rIO71p6DOGxHmt5QorgOYKjypiUysf/6c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2e3e18c240fso18460581fa.0 for ; Tue, 07 May 2024 14:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasko-net.20230601.gappssmtp.com; s=20230601; t=1715117651; x=1715722451; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ECF35bQ75xy4UJyPMkcep3IzB9YINrsP7AmR42wsShg=; b=1oXa6ScHWPGbJMuwiEEQIZVku3dkRSE5Twyjec3L2Z7oVoRipAtX2N8Ljt7CbhA8G4 uwZ+acsBQp1tlbuGmDZuHr/EFr24Yd0pYVeEsizT1iwAjANzPJjXBdTVyaXVN3NhCxyu cLjkNnFmx39nixL9A1V/JHYJDzR4cLH9RBtC08LpyEzu8G88FFKXFeifIpmRC7X76A42 3RS3boJlzZCKFP5kInfB2uu/kpsruZeUqcZFnYKTMp9Wz6tt0FasvIRGssxcsfKgu2n8 PwHDUQwlT/mMykoWFgUFBqmvjKujHJ3O1+MrgYhXf/ePWm1A1Mc4XEHJLyu9wS4G7has GKOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715117651; x=1715722451; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ECF35bQ75xy4UJyPMkcep3IzB9YINrsP7AmR42wsShg=; b=VkE97LKrPalQB/BEdC/gqT+m4OlCTOzKv0DQIqaC/DU2ES0W6VPbT71Du2tE7wOpUS MJzZwnyUWGpXtoaYR8vQMxnuav+Io4ytALTT2nKuaw4RutBIbfFEvSIYaCTBQnljKQd/ zh8yXxSj3+THPcThvEIU3kHcQuoXFrbD1YURIBmAtlV3YJ85qdVBAT/2hYoRBz76WEW7 H14mvHRuRYY5EInt9l4rmkQ1M8UsczpRWArPmF6dCXS1tMHuYluoYr5Uxsin3qOqcULh hrJsHEux0GjyWOw/UrbPd8+2NrzPZXojlwPjEyWRXubFw/3+wgR+yVu3NCchqz2cSiKN GJyg== X-Gm-Message-State: AOJu0YzTj2a/Tdua8fYYO8oJ3RsmrGw7PSxjBZJPVX5PcTl9sIoLstFD 9rls7P4Kx8WOxFAjJ32MGm8iqEywVr41vAbwPKRGUGSsEkbHqGwrxKkOHiMG3FhSgFBi90Y+R+k eQcSzsZWfiJJh4+xcQCPhfnjlemmzI9043UE09eXrw1FqCuTgzgA= X-Google-Smtp-Source: AGHT+IG6DyfKUT8YXfzfGoMFHvPxdYi2yLcMQitxH9hzDbB7xE+D4v9D1AS2BbZfpLZNeGKXoWWGvJiKndsGVX+ByXU= X-Received: by 2002:a2e:81c5:0:b0:2dd:3803:e1da with SMTP id 38308e7fff4ca-2e446e8113emr5241301fa.12.1715117650675; Tue, 07 May 2024 14:34:10 -0700 (PDT) MIME-Version: 1.0 References: <87ikzpa7k6.fsf@tromey.com> In-Reply-To: <87ikzpa7k6.fsf@tromey.com> From: Robert Rossi Date: Tue, 7 May 2024 17:33:58 -0400 Message-ID: Subject: Re: Optionally print source code to gdb console window To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: multipart/alternative; boundary="000000000000512b1b0617e3f206" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000512b1b0617e3f206 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tom, Thanks for the feedback. This is wrong in a few directions unfortunately. The first is that the output looks like this in the suggested case, (gdb) n 43 in test_main.cpp (gdb) 44 in test_main.cpp (gdb) n 47 in test_main.cpp (gdb) list 42 in test_main.cpp Which is not what the user wants. They don't want to see the updates in the console regarding source positions. In addition, you can see capabilities they may want, 'list', no longer work. The reason this issue was noticed in the first place is because this was the vision of the original gdb maintainers when using annotate=3D2. In that mod= e, no source code would be printed to the console. However, in mi new-ui mode gdb does print the source code to the console. My personal opinion is that gdb shouldn't print code to the console in mi mode or in new-ui mode. However, there were some people from eclipse a few years ago that said they disagreed and that gdb should behave identical in new-ui mode and not in new-ui mode, so i've attempted to make an option. I'm happy to add docs and a test case. Can you give me some pointers on how the implementation should change? I should also ask, is an option even necessary? I think if we remove the source printing from the console when in new-ui mode or in mi-mode it would make the most sense. After all, there is a front end displaying this information, no? Thanks, Bob Rossi On Tue, May 7, 2024 at 12:52=E2=80=AFPM Tom Tromey wrote: > >>>>> "Robert" =3D=3D Robert Rossi writes: > > Thank you for the patch. > > Robert> A little history. When using --annotations, gdb did not print > Robert> the source code to the gdb console window. When using mi with > Robert> new-ui it does. When I reported this in the past, several > Robert> people said it was a feature that gdb printed the source code > Robert> lines to the console. > > Robert> I've had several users of cgdb say they do not want gdb to print > Robert> the source code to the gdb console window as they can see the > Robert> code in the code view. > > Robert> I've created and attached a patch that I hope makes it optional > Robert> to have gdb print the source code to the gdb console > Robert> window. Could I have some feedback? > > I was reviewing your patch and I found is a pre-existing setting that > claims to do what you want: "set source open off". > > Could you try this and see if it works? I suspect this is the way to > go. > > Otherwise, we can look at your patch. From a first read, I think the > idea is totally fine, but the implementation would need to be changed. > Also it would need documentation and a test case. > > thanks, > Tom > --000000000000512b1b0617e3f206--