From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0A44A3858D37 for ; Sat, 16 Sep 2023 10:18:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A44A3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694859497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9luH6IZVHBLspqV74KD9R4A6P+Qls6V4vctNFz8fTWY=; b=GVsiclPEB0FJbInKl5sqP3L3XS0eFDD8n6mXgVHcZCheLi6KKhHujxGYyQxCm6W689dZvs V/fY0MOiLKk0PK2ukfA5mOG0Xs4hldDGY4Yp8hq8rglCBnr6TeJPhBX6BenbUqL+eaNUTU 2y4ljD9909QcB+t+vbRtDJxA7jUn/Fo= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-sg5zkQnROzm4Pwb4ug3qOQ-1; Sat, 16 Sep 2023 06:18:16 -0400 X-MC-Unique: sg5zkQnROzm4Pwb4ug3qOQ-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-502f46691b4so1764016e87.3 for ; Sat, 16 Sep 2023 03:18:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694859494; x=1695464294; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9luH6IZVHBLspqV74KD9R4A6P+Qls6V4vctNFz8fTWY=; b=SZQEXkJKMEHhQo9UBlJ21CpokHDVPeNqrtpCDgbbRcCsShMHYEBoJgFrng3PsNA5Oy 0SQA+l5Au/4O2n72Lsmn0JVT91Ja5HMgxBSafkppKsEQP8aqxzxGiYRZKHqBCJ4ZfrjF +0EAd5ajocNpdxWd7w6Y8dhNq4t2QVsFff469W5HD9OPj4v4w04iT7DARAYCjefG8Ija NtwdfR/6yaf0GnaQedWUT2FxMMeDPRVTZeIIA8Fw1AKr3ULLMKp8PDLaG/YdNl3lDbFY TM+B+MRoTPP65DU+6rX/Xwk2VMwZjsGteF3EuDh2Q1QN0P/nMbt/bRsnUKLxsdF1wQb7 0KWg== X-Gm-Message-State: AOJu0YyAqnMXh6gzgdQwl3ruSiM1+UPVpSZi7hJC+FNOlBqWjCM6k2T/ 24I2m+G2smjDG33Y4fUnny2qptvAjX6bhfQQRDgDb1s5zPGiligQnDktGc7bT3B9tO+gvVbRiBF rOvcDdMnoOKTwCNWQpKAlBAAgjOjjkuWMHvaWC4KO/qwidZHqpoZwUYZ+F4B04LBi+8T5/KVy7W vV7aFLCA== X-Received: by 2002:a05:6512:1597:b0:4fd:fd97:a77b with SMTP id bp23-20020a056512159700b004fdfd97a77bmr4419485lfb.50.1694859494260; Sat, 16 Sep 2023 03:18:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPumw2A6tJ0EdiyEchODzMqISy/kwdCxEztaaiKQPVbfoCBiWfU2Up6lgH1U1QKmdaBIzQcA== X-Received: by 2002:a05:6512:1597:b0:4fd:fd97:a77b with SMTP id bp23-20020a056512159700b004fdfd97a77bmr4419467lfb.50.1694859493782; Sat, 16 Sep 2023 03:18:13 -0700 (PDT) Received: from localhost (92.40.218.107.threembb.co.uk. [92.40.218.107]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c231a00b003fe1a96845bsm9868390wmo.2.2023.09.16.03.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 03:18:13 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 0/9] Add executable_changed event to Python API Date: Sat, 16 Sep 2023 11:18:01 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: When I started, I thought this would be trivial; I wanted to expose the executable_changed observer through the Python API. Well, it turns out that the executable filename isn't directly visible from the Python API, so having an event for when it changes doesn't make a great deal of sense. So the first 3 patches sort that out. Then, once I started looking at how the executable_changed observer is used, it feels like it is currently overloaded a little, and, as a result, triggers more than it needs to. The next 3 patches try to sort this out. Then patch 7 adds some additional arguments to the executable changed observer. Patch 8 is the trivial patch that exposes the observer as an event in the Python API. .... And patch 9 fixes a final bug/annoyance which I ran into while writing the tests for patch 8. --- Andrew Burgess (9): gdb/doc: extend the description for Progspace.filename gdb/python: new Progspace.symbol_file attribute gdb/python: new Progspace.executable_filename attribute gdb: remove one user of the executable changed observer gdb: remove final user of the executable_changed observer gdb: remove unnecessary notification of executable_changed observer gdb: pass more arguments to the executable_changed observer gdb/python: make the executable_changed event available from Python gdb: use reopen_exec_file from reread_symbols gdb/NEWS | 16 ++ gdb/auxv.c | 10 +- gdb/doc/python.texi | 71 +++++++- gdb/exec.c | 11 +- gdb/observable.h | 18 +- gdb/python/py-all-events.def | 1 + gdb/python/py-event-types.def | 5 + gdb/python/py-progspace.c | 100 ++++++++++- gdb/symfile.c | 22 +-- gdb/symtab.c | 18 +- gdb/testsuite/gdb.python/py-exec-file.c | 22 +++ gdb/testsuite/gdb.python/py-exec-file.exp | 195 ++++++++++++++++++++++ gdb/testsuite/gdb.python/py-progspace.exp | 9 + 13 files changed, 458 insertions(+), 40 deletions(-) create mode 100644 gdb/testsuite/gdb.python/py-exec-file.c create mode 100644 gdb/testsuite/gdb.python/py-exec-file.exp base-commit: 5a6dafd5f1110e8b642fdf65c13d8543e469a09e -- 2.25.4