From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 2BC503857C53 for ; Tue, 26 Oct 2021 09:38:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2BC503857C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x32d.google.com with SMTP id j2-20020a1c2302000000b0032ca9b0a057so1535271wmj.3 for ; Tue, 26 Oct 2021 02:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EDFxnzQZgr6UvzBgP5T0wANNgZMdiEgwVgYzcZlMzJY=; b=SY9qcMrjZNvZYSAXm081hQFAqxWv46XHlnbO3zU+9jCH+7/Q4CTd1Up3mTsauHTDT3 bVFIFq3o85t9eHC3c7/ngPYHbAAWhvUJ2fXhoCAZm9qo4FACN2kxOoB+RM1aN30AkGw8 Zlyl6YwaIzrLis/8WnIPQTwfAq6qCXJ9sbQ2HkL6QAT/GSRolfOeYfmE4IjUbxKYQNxd 0ksh8oWCdwVoZcWBi/Jmb3+Lfh16CBcFNtqQVKeZGKprphKXzQvgpRGvod3l/2rTY4Mx qpkRaQZpSpe8hb1otUsgEwIjsI1COdQSGWBamAUA1lqOLUrCWWMgVqYd2IqmTUskzFOU nkfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EDFxnzQZgr6UvzBgP5T0wANNgZMdiEgwVgYzcZlMzJY=; b=pBu7hhPnSZ/UcQm/vrm1NtrZZSuCv+g10HWsdA5Y3hNiAdU/Q0rT6yAJBVlo20UOoZ i7+rnPltKipfPWYmut/xVDq4hVR3X7Z0OV/Q5mSLgQE4i9hj57F159whpsSzWt3eKTsC 5g5Lp80xECD8y2Ho54/WkYrqhoTiaSdtDIHVwkshUL96lmQTb7NIXgB+KvXPbcUOS3qh vp5RtGn9XkM25ulDvX/IbKbOyY/JdPDk5TBo7Q9xKxzdbtI9agitw34h257VMSe6FPwo c4F4qYB2SEK7thPVN5zZLSoNxcR5spXaU+dDP39rvQqjEZzQ+/U+YBz8pimDd4xc0W6/ bC5A== X-Gm-Message-State: AOAM533ltelI0Z+kUCap2tQOzv5prSuvfSwNR2XHYjJFvaE4BsiAohy9 ef3Odztp1kU5gEFEAGevAyJdiKGDdOTMnQ== X-Google-Smtp-Source: ABdhPJwTfkqdJLqmHYebvPjsarUbIJ7IMvRVU6loxe84zbvTKbGAOn3nzkhEIZu2/dhDFnxJLa5ncA== X-Received: by 2002:a1c:1941:: with SMTP id 62mr25577133wmz.131.1635241084007; Tue, 26 Oct 2021 02:38:04 -0700 (PDT) Received: from localhost (host86-180-62-146.range86-180.btcentralplus.com. [86.180.62.146]) by smtp.gmail.com with ESMTPSA id m12sm5694689wrq.69.2021.10.26.02.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 02:38:03 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 2/4] gdb: rename source_styling_changed observer Date: Tue, 26 Oct 2021 10:37:57 +0100 Message-Id: <33d7cb45d4f4e7d99ef12dbbf2d1606d0aa27d32.1635241044.git.andrew.burgess@embecosm.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2021 09:38:07 -0000 In the next commit I plan to add disassembler styling. In the same way that we have a source_styling_changed observer I would need to add a disassembler_styling_changed observer. However, currently, these observers would only be notified from cli-style.c:set_style_enabled, and observed in tui-winsource.c, tui_source_window::style_changed, as a result, having two observers seems unnecessary right now, so, in this commit, I plan to rename source_styling_changed to just styling_changed, then, in the next commit, I can use the same observer for both source styling, and disassembler styling. There should be no user visible changes after this commit. --- gdb/cli/cli-style.c | 2 +- gdb/observable.c | 2 +- gdb/observable.h | 6 +++--- gdb/tui/tui-winsource.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c index aca19c51b84..228fa698c13 100644 --- a/gdb/cli/cli-style.c +++ b/gdb/cli/cli-style.c @@ -279,7 +279,7 @@ static void set_style_enabled (const char *args, int from_tty, struct cmd_list_element *c) { g_source_cache.clear (); - gdb::observers::source_styling_changed.notify (); + gdb::observers::styling_changed.notify (); } static void diff --git a/gdb/observable.c b/gdb/observable.c index b020076cf26..d965ec3e52d 100644 --- a/gdb/observable.c +++ b/gdb/observable.c @@ -75,7 +75,7 @@ DEFINE_OBSERVABLE (inferior_call_pre); DEFINE_OBSERVABLE (inferior_call_post); DEFINE_OBSERVABLE (register_changed); DEFINE_OBSERVABLE (user_selected_context_changed); -DEFINE_OBSERVABLE (source_styling_changed); +DEFINE_OBSERVABLE (styling_changed); DEFINE_OBSERVABLE (current_source_symtab_and_line_changed); DEFINE_OBSERVABLE (gdb_exiting); diff --git a/gdb/observable.h b/gdb/observable.h index f20f532870f..707c214ac66 100644 --- a/gdb/observable.h +++ b/gdb/observable.h @@ -241,9 +241,9 @@ extern observable extern observable user_selected_context_changed; -/* This is notified when the source styling setting has changed and - should be reconsulted. */ -extern observable<> source_styling_changed; +/* This is notified when a styling setting has changed, content may need + to be updated based on the new settings. */ +extern observable<> styling_changed; /* The CLI's notion of the current source has changed. This differs from user_selected_context_changed in that it is also set by the diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 955b68901fe..e2ab87eb9d4 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -292,14 +292,14 @@ tui_source_window_base::tui_source_window_base () m_start_line_or_addr.loa = LOA_ADDRESS; m_start_line_or_addr.u.addr = 0; - gdb::observers::source_styling_changed.attach + gdb::observers::styling_changed.attach (std::bind (&tui_source_window::style_changed, this), m_observable, "tui-winsource"); } tui_source_window_base::~tui_source_window_base () { - gdb::observers::source_styling_changed.detach (m_observable); + gdb::observers::styling_changed.detach (m_observable); } /* See tui-data.h. */ -- 2.25.4