From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id F19533834C2C for ; Wed, 7 Dec 2022 15:19:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F19533834C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x131.google.com with SMTP id a18so5443463ilk.9 for ; Wed, 07 Dec 2022 07:19:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Qqi+/SyJ9iAH3Iev5Yx36aCyYx0jKs6FxAxsv1Oer+k=; b=Tu1jZx60IVUGHKoX+7HyHjbHVHabo1jFMbAVGDCT1/jPLobisY7qO5++voaJPYtBel AqG0uLVD59A4IlHfTvu/d1sYWsYV/TMSaC3go2Zzc3TXDGZTaAhdu1va2ZqpbvDg8xXH AkrGSnat1fb5YMtARguqfwKPmcxXkw39W4dhCOXyuSToSoTaHXs8HL/ld9+I3Pw2HLqs UXBtZ0R4jhQ1FCMNQkBsNFu/jbJN6NbKBZbRigN9rT/N0WqwLOxbrJ8oqJUhXuCzXWuw 9T0bnDhQLFzSFnmwwgQys0uB4O4lnXCiAAmuFZ5dc/v+4hNV4K6zPC7M1Pe/U8PI3syF OzhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Qqi+/SyJ9iAH3Iev5Yx36aCyYx0jKs6FxAxsv1Oer+k=; b=4iNLtsFnLD5o4gXaOgb/eQw5Ub9tDtTOslJytHq6PkodzIs7oegauYUGdQ3QYK9ZG2 8ZHwtyqa611bV8u4OgIirZlBbyF/qwtZs5RMqijDYMZoWYi+lOZ8E+vCtyGUPJqRbHGx nv8Sbr2xvmFK7RqRFJJ3E0q8KVWw1bi3r0XbmK2jlNZ3nsYKUNZARUDKsAgZQRddJ7Rr AzlJsFZlSRcctLeKEnqd7zl/Rcsbv4kHVuQ2lyL66tC7hHsvs9om7ds2usuAa2PseszR N5tFZeiIOskd4cVZHkJJV9UtsDTFtGEJ02jwSIQqtjhRFb4k0ZImGa6iAoBkPC+AhGAg l5Og== X-Gm-Message-State: ANoB5pnm8Ds4yp31hCGyiw6QsMg/AXO9CFVZxkpUOSHDagQdiwk2kfVu zhGQlmZxMcCQWO9t/hOX8ivhclHceDXw3We6 X-Google-Smtp-Source: AA0mqf4WmdaY7SPa5nv56QJMZya9htUPl7+KhQRp5Fg36U8/UtZkzI6Yg57D9YSFeQqrH1SS/wl9jw== X-Received: by 2002:a05:6e02:f0e:b0:303:2603:c008 with SMTP id x14-20020a056e020f0e00b003032603c008mr16462779ilj.134.1670426369168; Wed, 07 Dec 2022 07:19:29 -0800 (PST) Received: from localhost.localdomain (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id t5-20020a02ab85000000b0038a434685dbsm3636604jan.102.2022.12.07.07.19.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 07:19:28 -0800 (PST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Remove unnecessary xstrdup from bppy_init Date: Wed, 7 Dec 2022 08:19:19 -0700 Message-Id: <20221207151919.2894085-1-tromey@adacore.com> X-Mailer: git-send-email 2.34.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.1 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I saw that bppy_init used a non-const "char *". Fixing this revealed that the xstrdup here was also unnecessary, so this patch removes it. --- gdb/python/py-breakpoint.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index 7a757432948..63b18bd0f92 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -938,16 +938,14 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs) } case bp_watchpoint: { - gdb::unique_xmalloc_ptr - copy_holder (xstrdup (skip_spaces (spec))); - char *copy = copy_holder.get (); + spec = skip_spaces (spec); if (access_type == hw_write) - watch_command_wrapper (copy, 0, internal_bp); + watch_command_wrapper (spec, 0, internal_bp); else if (access_type == hw_access) - awatch_command_wrapper (copy, 0, internal_bp); + awatch_command_wrapper (spec, 0, internal_bp); else if (access_type == hw_read) - rwatch_command_wrapper (copy, 0, internal_bp); + rwatch_command_wrapper (spec, 0, internal_bp); else error(_("Cannot understand watchpoint access type.")); break; -- 2.34.3