From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112780 invoked by alias); 22 Feb 2017 22:23:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 112765 invoked by uid 89); 22 Feb 2017 22:23:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=170222, 17-02-22, H*f:sk:20baebc, H*MI:sk:20baebc X-HELO: mail-wm0-f65.google.com Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Feb 2017 22:23:21 +0000 Received: by mail-wm0-f65.google.com with SMTP id v77so2812829wmv.0 for ; Wed, 22 Feb 2017 14:23:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yyC8MovsVEe6VlohnQJTzG99BW+LJ/jahessdunSrb4=; b=pXOXI8txQoN76i5T6DWahDZ0uybnf+BXjuh/vIrJHdXVylJzBiETxuTKfKgjTlYnAc +6/jFaWJ3Sr08ukNRPSBmvxf2EzlrtlJ71VajDfoOSBdS8+5dGLVppnlrISH80yi6O38 QN9ckfFm1JQ6DaPYTpAgUMQXw/9BKQ7w/bAYt45oTcH2KpciahHGfnOYaqy6QpYoMC/r +Aq9BkSGJBscBHiljAVHsKHaxj5Zz0PzaFQ4sG9DagCMX2s1/2ErUxfX9GHMdJ3ZExBy y51BOhxgt+kJm6psvCO/41QwtEdF/SNllIaAibYtnKUX73+PIvo6YysnKPo4dxcHqkEw TYOA== X-Gm-Message-State: AMke39mmvnB+Hz/Sh8pa53WDSt0WWlzQub0kZ8GVDoDDJdsgh3dw6j9xJKM/2m2rpPpxHw== X-Received: by 10.28.147.147 with SMTP id v141mr652513wmd.110.1487802199804; Wed, 22 Feb 2017 14:23:19 -0800 (PST) Received: from localhost ([2a02:c7d:8e39:c00:907d:dd4f:8d3c:1550]) by smtp.gmail.com with ESMTPSA id z10sm3695576wmg.31.2017.02.22.14.23.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Feb 2017 14:23:19 -0800 (PST) Date: Wed, 22 Feb 2017 22:23:00 -0000 From: Yao Qi To: Pedro Alves Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH v1.1 1/3] Introduce gdb::function_view Message-ID: <20170222222316.xaeqa67lmil52c7j@localhost> References: <1487775033-32699-1-git-send-email-palves@redhat.com> <1487775033-32699-2-git-send-email-palves@redhat.com> <8636f39b5e1e2cbdeabbf8dfd999e709@polymtl.ca> <4c8528d8-0115-3bf3-0a16-42f44be580a9@redhat.com> <20baebcd-0f6a-89ca-ef34-503795171d43@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20baebcd-0f6a-89ca-ef34-503795171d43@redhat.com> User-Agent: NeoMutt/20161104 (1.7.1) X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00612.txt.bz2 On 17-02-22 17:49:22, Pedro Alves wrote: > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 43253d3..a4cac36 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -523,6 +523,12 @@ SUBDIR_PYTHON_DEPS = > SUBDIR_PYTHON_LDFLAGS = > SUBDIR_PYTHON_CFLAGS = > > +SUBDIR_UNITTESTS_SRCS = \ > + unittests/function-view-selftests.c > + > +SUBDIR_UNITTESTS_OBS = \ > + function-view-selftests.o > + > # Opcodes currently live in one of two places. Either they are in the > # opcode library, typically ../opcodes, or they are in a header file > # in INCLUDE_DIR. > @@ -1216,7 +1222,8 @@ SFILES = \ > common/xml-utils.c \ > mi/mi-common.c \ > target/waitstatus.c \ > - $(SUBDIR_GCC_COMPILE_SRCS) > + $(SUBDIR_GCC_COMPILE_SRCS) \ > + $(SUBDIR_UNITTEST_SRCS) > > LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c > > @@ -1800,7 +1807,8 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ > xml-syscall.o \ > xml-tdesc.o \ > xml-utils.o \ > - $(SUBDIR_GCC_COMPILE_OBS) > + $(SUBDIR_GCC_COMPILE_OBS) \ > + $(SUBDIR_UNITTESTS_OBS) > Can we add SUBDIR_UNITESTS_OBS to CONFIG_OBS (in configure.ac) if GDB_SELF_TEST is defined? > TSOBS = inflow.o > > @@ -1909,6 +1917,10 @@ all: gdb$(EXEEXT) $(CONFIG_ALL) > $(COMPILE) $< > $(POSTCOMPILE) > > +%.o: ${srcdir}/unittests/%.c > + $(COMPILE) $< > + $(POSTCOMPILE) > + > # Specify an explicit rule for gdb/common/agent.c, to avoid a clash with the > # object file generate by gdb/agent.c. > common-agent.o: $(srcdir)/common/agent.c > @@ -2124,7 +2136,13 @@ test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY) > # duplicates. Files in the gdb/ directory can end up appearing in > # COMMON_OBS (as a .o file) and CONFIG_SRCS (as a .c file). > > -INIT_FILES = $(COMMON_OBS) $(TSOBS) $(CONFIG_SRCS) $(SUBDIR_GCC_COMPILE_SRCS) > +INIT_FILES = \ > + $(COMMON_OBS) \ > + $(TSOBS) \ > + $(CONFIG_SRCS) \ > + $(SUBDIR_GCC_COMPILE_SRCS) \ > + $(SUBDIR_UNITTESTS_SRCS) > + If so, SUBDIR_UNITESTS_SRCS is added to CONFIG_SRCS, we don't need this change. > diff --git a/gdb/unittests/function-view-selftests.c b/gdb/unittests/function-view-selftests.c > new file mode 100644 > index 0000000..3e5369b > --- /dev/null > +++ b/gdb/unittests/function-view-selftests.c > @@ -0,0 +1,184 @@ > +/* Self tests for function_view for GDB, the GNU debugger. > + > + Copyright (C) 2017 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#include "defs.h" > +#include "selftest.h" > +#include "common/function-view.h" > + > +#if GDB_SELF_TEST If gdb/unittests/*.c are compiled when GDB_SELF_TEST is defined, we don't need to check GDB_SELF_TEST here. > + > +namespace selftests { > +namespace function_view { > + > + > +} /* namespace function_view */ > +} /* namespace selftests */ > + > +#endif > + > +void > +_initialize_function_view_selftests () > +{ > +#if GDB_SELF_TEST This is not needed as well. > + register_self_test (selftests::function_view::run_tests); > +#endif > +} > -- > 2.5.5 > > -- Yao