Received: from eggs.gnu.org ([2001:4830:134:3::10]:41767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtEf8-0008QL-5R for qemu-devel@nongnu.org; Fri, 15 May 2015 08:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtEf4-0008DE-Qo for qemu-devel@nongnu.org; Fri, 15 May 2015 08:24:22 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:35393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtEf4-0008D4-Jd for qemu-devel@nongnu.org; Fri, 15 May 2015 08:24:18 -0400 Received: by wgnd10 with SMTP id d10so108644112wgn.2 for ; Fri, 15 May 2015 05:24:17 -0700 (PDT) From: hw.claudio@gmail.com Date: Fri, 15 May 2015 14:25:23 +0200 Message-Id: <1431692725-27656-1-git-send-email-hw.claudio@gmail.com> Subject: [Qemu-devel] [RFC v5 0/2] monitor: add memory search commands s, sp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino , Paolo Bonzini Cc: Peter Maydell , Gonglei , Claudio Fontana , qemu-devel@nongnu.org From: Claudio Fontana Hello, I went ahead and tried to build the general solution for replacing memmem on systems which don't provide one (notably Windows), detecting the presence of memmem in configure and setting CONFIG_MEMMEM, and providing an implementation (from gnulib) for the !CONFIG_MEMMEM case. The code imported is GPLv2 in the "or later" form, which I have seen used in the util library already. I have tested this in both CONFIG_MEMMEM defined/undefined scenarios, but more feedback and testing is welcome of course. changes from v4: made into a series of two patches. Introduced a memmem replacement function (import from gnulib) and detection code in configure. changes from v3: initialize pointer variable to NULL to finally get rid of spurious warning changes from v2: move code to try to address spurious warning changes from v1: make checkpatch happy by adding braces here and there. Claudio Fontana (2): util: add memmem replacement function monitor: add memory search commands s, sp configure | 15 ++ hmp-commands.hx | 28 ++++ include/qemu/osdep.h | 4 + monitor.c | 140 ++++++++++++++++ util/Makefile.objs | 1 + util/memmem.c | 73 +++++++++ util/str-two-way.h | 452 +++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 713 insertions(+) create mode 100644 util/memmem.c create mode 100644 util/str-two-way.h -- 1.8.5.3