From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuIPd-0005kF-Ry for qemu-devel@nongnu.org; Wed, 24 Mar 2010 00:41:49 -0400 Received: from [140.186.70.92] (port=35149 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuIPc-0005jA-2e for qemu-devel@nongnu.org; Wed, 24 Mar 2010 00:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuIPb-0006Re-1n for qemu-devel@nongnu.org; Wed, 24 Mar 2010 00:41:47 -0400 Received: from mail-qy0-f188.google.com ([209.85.221.188]:34574) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuIPa-0006RB-VQ for qemu-devel@nongnu.org; Wed, 24 Mar 2010 00:41:47 -0400 Received: by qyk26 with SMTP id 26so4275065qyk.19 for ; Tue, 23 Mar 2010 21:41:45 -0700 (PDT) MIME-Version: 1.0 From: Aravind Prakash Date: Wed, 24 Mar 2010 00:41:25 -0400 Message-ID: <15537c51003232141w234dc989v270de419ccb46498@mail.gmail.com> Content-Type: multipart/alternative; boundary=00163628482026b4b30482848c0c Subject: [Qemu-devel] Regarding tcg_gen_helper List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --00163628482026b4b30482848c0c Content-Type: text/plain; charset=ISO-8859-1 Hello, My name is Aravind. I am working on a project which involves inserting code to call one of my functions. This is what it looks like: //The function to be called. void log_entry(int reg, int data) { printf("REG access\n"); printf("Data got REG = %d and data = %d\n", reg, data); fprintf(logfileptr, "Register = %d, Data = %d\n", reg, data); } static inline void gen_reg_log(int reg, int data) { //This is effectively calling tcg_gen_helper64 without the sizemask TCGv_ptr fn; TCGArg args[2]; fn = tcg_const_ptr((tcg_target_long)log_entry); args[0] = GET_TCGV_I64(reg); args[1] = GET_TCGV_I64(data); tcg_gen_callN(&tcg_ctx, fn, 0, 0, 0, 2, args); tcg_temp_free_ptr(fn); } When I run this, I get a segfault. I do not know where to proceed. Any suggestions will be appreciated. Thanks, Aravind. --00163628482026b4b30482848c0c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,
My name is Aravind. I am working on a project which involves inse= rting code to call one of my functions.
This is what it looks like:
=
//The function to be called.
void log_entry(int reg, int data)
{
=A0=A0=A0=A0=A0 printf("REG access\n");
=A0=A0=A0=A0=A0 p= rintf("Data got REG =3D %d and data =3D %d\n", reg, data);
=A0= =A0=A0=A0=A0 fprintf(logfileptr, "Register =3D %d, Data =3D %d\n"= , reg, data);
}

static inline void gen_reg_log(int reg, int data)=
{
//This is effectively calling tcg_gen_helper64 without the sizemask=A0=A0=A0=A0=A0=A0=A0 TCGv_ptr fn;
=A0=A0=A0=A0=A0 TCGArg args[2];
= =A0=A0=A0=A0=A0=A0 fn =3D tcg_const_ptr((tcg_target_long)log_entry);
=A0= =A0=A0=A0=A0 args[0] =3D GET_TCGV_I64(reg);
=A0=A0=A0=A0=A0 args[1] =3D GET_TCGV_I64(data);
=A0=A0=A0=A0=A0 tcg_gen_= callN(&tcg_ctx, fn, 0, 0, 0, 2, args);
=A0=A0=A0=A0=A0 tcg_temp_free= _ptr(fn);
}

When I run this, I get a segfault. I do not know wher= e to proceed. Any suggestions will be appreciated.

Thanks,
Aravind.

--00163628482026b4b30482848c0c--