From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 3DC2C3858C50 for ; Wed, 8 May 2024 23:07:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DC2C3858C50 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 3DC2C3858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715209649; cv=none; b=kOY+ogNmCvqTF6m9VqdhQae4mUYOevEWrTgyy3Y9p42z9IV5UTb00v5CUvvnAA+B+PAVwID4//TaINKVvH4NwUh17rUq5uDqsWhAf+Y1VxVy3sgaMotjf6EKQauN8+FPfu+u4iJB2n5i3Butn86HSMvCDh3erMSMft7qhwPg6AQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715209649; c=relaxed/simple; bh=nGGwADAnDXw3TTvT0YTvFv2tMtG3P97NaKyf6JS/EKQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=cT5EmGX/SgN1nRuwayYu36cD3TE1geAeNAv78Buk5pIVg2o3MdHkCG8sxsmH/lyQurWs0KNwgNYUHPvGCogcKD6fczMy7FCeUds4TKXYF1Al0soUMr4YdTkys3AZvYNo9HcV9Xu+3QK2StBlWdKJvYSjMLasmSKYt621GQKqyFM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6eb86b69e65so138786a34.3 for ; Wed, 08 May 2024 16:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasko-net.20230601.gappssmtp.com; s=20230601; t=1715209646; x=1715814446; darn=sourceware.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=josPi4u0rhrwJB+Ab4E2AdEQKN9hiO668fs4GuyPxTs=; b=czS7q/lrej5FeSqMNeGRdmt3IdxFzZDZx2Yfw0QnY+99AFJKYjy0SHBCkipaeAp9Fu T/BVm97OFYMN0NgiAnmQXyNgQFpzuAlNxHn106UMNHsqP98NAzlSIUbp/SQkl8bjl7wZ 5+PF7cC7+4oQEZTXfpYcX0hobAI9cmEy2/gqifO+9E11IJCu8WtlcSuHp0eQTz8K2EaO bBSz6bDQ6c3FEsNJSC9dDMxtXlwgNpj8T0Gfu0WnSgk+ahPJ8RYeGiNxu6XZCbjZdKEE SknVRtKKQvGrVwziqpEH9eTeOvN5tRS+bYHXdQiXkCwDsl4A+ry0/V4QMKP8leZc7KR6 gX6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715209646; x=1715814446; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=josPi4u0rhrwJB+Ab4E2AdEQKN9hiO668fs4GuyPxTs=; b=oLW8pHc0bDs3Eghdllx69mjRIuI6JwOyIlSmLfnEm5O+8RSAXiYoIvi4rhuGlp3U6u sN/YAK+lvKTNyVhDlZC6U3Gs8Xp5Eck8xWV2H9GNhVqkGkg+D+oQmMF50UpTEjS0HkA1 9yOOWRZ1d4b/Irht0XFMyMmTz15D+avh/4Xuljyn/8Dv/axcuqyZdvDlvjSmzwh17Q8z IRVr79NSObOnbq3Wq75Nu2Ys14q43UKY4BaEzZe3Vg8ghYD1jSVdrMC1bOp52RaNKN8i 9y6HKvJabd4/TfqaRfEUUY/l656GvBvhGYqlFCZWcTylNT2P57AIIbsNp83COvk/tDsL lnxA== X-Gm-Message-State: AOJu0YxbN3XR/L3xn2eNRY/8H2/HB5USZDHuOG4FWl+HQ++RpVNQeK7u B8xEkpgVXDxbFScONDT3yGr65cdq1/8cQDeU78a2+UUZ8vzenLRXBFIxAAwwzPTte8cr/rmkaYi 4 X-Google-Smtp-Source: AGHT+IEv1qiuGBRvifJZ0OQyG0ZbPtOJn+Kpa/utjI78fuf9K5fOQYvxQCIrfaR65ao4nFEfsxQ1yw== X-Received: by 2002:a9d:764e:0:b0:6f0:6361:2d86 with SMTP id 46e09a7af769-6f0b704ebf2mr4715952a34.0.1715209646401; Wed, 08 May 2024 16:07:26 -0700 (PDT) Received: from zelda (pool-108-12-199-157.prvdri.fios.verizon.net. [108.12.199.157]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf27f8e1sm2408885a.34.2024.05.08.16.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 16:07:25 -0700 (PDT) Date: Wed, 8 May 2024 19:07:23 -0400 From: Bob Rossi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: Optionally print source code to gdb console window Message-ID: References: <87ikzpa7k6.fsf@tromey.com> <87y18lunti.fsf@tromey.com> <87a5l05mt3.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a5l05mt3.fsf@tromey.com> X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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: On Wed, May 08, 2024 at 09:46:16AM -0600, Tom Tromey wrote: > >>>>> "Bob" == Bob Rossi writes: > > >> Perhaps 'set source open' could be extended to have a new value. Or > >> perhaps some other 'set source' sub-option could be made. I'm afraid > >> that normally we bikeshed option names a bit. > > Bob> I think it's this behavior of gdb i want to suppress, > Bob> https://sourceware.org/gdb/current/onlinedocs/gdb#Source > Bob> "When your program stops, GDB spontaneously prints the line where it > Bob> stopped" > > Bob> I'm looking for a way to control printing source lines when printing > Bob> frame information? (I'm modifying do_print_frame_info) > > Bob> Something like 'set frame print_source off' might make sense to me. > Bob> Just a thought. > > How about adding a new value to "set print frame-info"? > Like "set print frame-info nothing"? I saw in the NEWS file, show print frame-info This controls what frame information is printed by the commands printing a frame. This setting will e.g. influence the behaviour of 'backtrace', 'frame', 'stepi'. The python frame filtering also respect this setting. The 'backtrace' '-frame-info' option can override this global setting. So i tried out how frame-info impacts the bt command, (gdb) set print frame-info short-location (gdb) n main (argc=1, argv=0x7fffffffe098) (gdb) bt #0 main (argc=1, argv=0x7fffffffe098) (gdb) set print frame-info auto (gdb) bt #0 main (argc=1, argv=0x7fffffffe098) at test_main.cpp:47 (gdb) The only request i've had, is not to print source lines automatically to the console, because cgdb already displays them in a source view. This is how cgdb worked with annotations, so people were familiar with that behavior in cgdb, until i upgraded to mi. I don't think people want gdb's behavior changed under cgdb. If they prefer special settings for 'print frame-info', they should probably be allowed to keep them and not have cgdb hijack them. A new option, but separate from the existing frame-info command, as to not impact other areas of gdb. set print frame-info-source-line off This is very similar to your approach, however, it lets the user choose whatever they want with print frame-info, and then it lets cgdb "subtract" the source-line printing from the console in only that case (and not bt case). What do you think about this crazyiness? Thanks, Bob Rossi