From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id BE5D03883027 for ; Wed, 19 Jun 2024 09:08:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE5D03883027 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BE5D03883027 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718788139; cv=none; b=qB06VncWOop+Lh32VIiPqDL7lSdhaf4J7GQYUOnhvLcXZM8FqlqQgYEKy2Ob/c6cEMX5CJXcjcFGhx+z0gt35N3L4jOsM1li6m5RF0A0rGGvM6g9w3/ntEFyV0Rbwk6gmprgIMxMVgBGIqTkWF+1Am6vi/ZcW7cvAaaQ/9C274k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718788139; c=relaxed/simple; bh=pk7uVilPFsfAW4lq3th0s4IG7FzhOlkPJd9r8ShGDQE=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=NXDWxe/lMXzx1MBgefIN0Ms+838UJmgLcM3BeDUyT03p71UirdXrF5CVt/dRVv7dpKUUPSC3ku/J30/Uc8olb94JCEkxLJqQlIqhpu0SkM5o4/CsYtDQDKAx2gCJaUSTlgZq+fWVuRsWSzWdaldatG+HOKsykKIYErL9BNViCQc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A69A21F815; Wed, 19 Jun 2024 09:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718788136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=un+iOrSQl0fNTaiel/O9OIErFyjqq9cLvbAkaD8w0p4=; b=0jrqGWhHCTDnnA9uo7iJZsf4jqv66dt6jpD9O4fUGRIe6+rUNpu7GpI5MZMBCcjCiVrJrY Spb0G1ekhW8H7EfMG4ehRkc8YAfByD1WkzkjgJByKRNIzpKpFfcDgNxEKg95lO5451Llq9 ueLl9JLXoBuZavv4fzAhIrzf3D/n8ao= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718788136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=un+iOrSQl0fNTaiel/O9OIErFyjqq9cLvbAkaD8w0p4=; b=J2WPAbxuYk1XSXSlfTMH/8i8xXlCkN+f5lM6YEw9l/kCc60syIN9M2ZWFd8voAH9Zd9mRz BozVkQFyaJLANKDw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=0jrqGWhH; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=J2WPAbxu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718788136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=un+iOrSQl0fNTaiel/O9OIErFyjqq9cLvbAkaD8w0p4=; b=0jrqGWhHCTDnnA9uo7iJZsf4jqv66dt6jpD9O4fUGRIe6+rUNpu7GpI5MZMBCcjCiVrJrY Spb0G1ekhW8H7EfMG4ehRkc8YAfByD1WkzkjgJByKRNIzpKpFfcDgNxEKg95lO5451Llq9 ueLl9JLXoBuZavv4fzAhIrzf3D/n8ao= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718788136; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=un+iOrSQl0fNTaiel/O9OIErFyjqq9cLvbAkaD8w0p4=; b=J2WPAbxuYk1XSXSlfTMH/8i8xXlCkN+f5lM6YEw9l/kCc60syIN9M2ZWFd8voAH9Zd9mRz BozVkQFyaJLANKDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 85F3913AAA; Wed, 19 Jun 2024 09:08:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id lVAaHyigcmaYKQAAD6G6ig (envelope-from ); Wed, 19 Jun 2024 09:08:56 +0000 Message-ID: Date: Wed, 19 Jun 2024 11:09:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] [gdb/python] Add typesafe wrapper around PyObject_CallMethod From: Tom de Vries To: Tom Tromey Cc: gdb-patches@sourceware.org, Lancelot SIX References: <20240612090137.12654-1-tdevries@suse.de> <87cyomfeis.fsf@tromey.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A69A21F815 X-Spam-Score: -4.50 X-Spam-Level: X-Spamd-Result: default: False [-4.50 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_THREE(0.00)[3]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 6/12/24 19:03, Tom de Vries wrote: > On 6/12/24 15:59, Tom Tromey wrote: >>>>>>> "Tom" == Tom de Vries writes: >> >> Tom> Add a typesafe wrapper around PyObject_CallMethod that hides these >> Tom> details, such that we can use the more intuitive: >> Tom> ... >> Tom>       gdbpy_ref<> result (gdbpy_call_method (m_window.get(), >> "hscroll", >> Tom>                                              num_to_scroll)); >> Tom> ... >> Tom> and: >> Tom> ... >> Tom>       gdbpy_ref<> result (gdbpy_call_method (m_window.get (), >> "render")); >> Tom> ... >> >> Tom> Tested on x86_64-linux. >> >> Tom> Co-Authored-By: Tom de Vries >> >> Thanks for following up on this. >> Approved-By: Tom Tromey > > Committed, with this fix: > ... >  template > -constexpr char gdbpy_method_format = '\0'; > +constexpr char gdbpy_method_format; > ... > to make sure that we get a compile time error rather than a runtime one > when using unsupported types. > And that caused a problem that Lancelot submitted a fix for here ( https://sourceware.org/pipermail/gdb-patches/2024-June/210071.html ). However, that doesn't seem to be the only problem. With gcc 14, on fedora rawhide, the build fails due to: ... /usr/bin/ld: python/py-disasm.o: in function `gdb::ref_ptr<_object, gdbpy_ref_policy<_object> > gdbpy_call_method(_object*, char const*, unsigned int, long long)': /data/vries/gdb/src/gdb/python/python-internal.h:207:(.text+0x384f): undefined reference to `_object* PyObject_CallMethod<_object*, char*, char*, unsigned int, long long>(_object*, char*, char*, unsigned int, long long)' /usr/bin/ld: python/py-tui.o: in function `gdb::ref_ptr<_object, gdbpy_ref_policy<_object> > gdbpy_call_method(_object*, char const*, int)': /data/vries/gdb/src/gdb/python/python-internal.h:207:(.text+0x1235): undefined reference to `_object* PyObject_CallMethod<_object*, char*, char*, int>(_object*, char*, char*, int)' /usr/bin/ld: python/py-tui.o: in function `gdb::ref_ptr<_object, gdbpy_ref_policy<_object> > gdbpy_call_method(_object*, char const*, int, int, int)': /data/vries/gdb/src/gdb/python/python-internal.h:207:(.text+0x12b0): undefined reference to `_object* PyObject_CallMethod<_object*, char*, char*, int, int, int>(_object*, char*, char*, int, int, int)' ... I tried applying the patch mentioned above, and that didn't fix it. Thanks, - Tom