This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
cancel: [PATCH 4/4] compile: New 'compile print'
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Phil Muldoon <pmuldoon at redhat dot com>
- Date: Sun, 5 Apr 2015 19:01:25 +0200
- Subject: cancel: [PATCH 4/4] compile: New 'compile print'
- Authentication-results: sourceware.org; auth=none
- References: <20150326205727 dot 28223 dot 54648 dot stgit at host1 dot jankratochvil dot net> <20150326205752 dot 28223 dot 24230 dot stgit at host1 dot jankratochvil dot net>
On Thu, 26 Mar 2015 21:57:52 +0100, Jan Kratochvil wrote:
> + fprintf_unfiltered (buf,
> +"__auto_type " COMPILE_I_EXPR_VAL " = %s;\n"
> +"typeof (%s) *" COMPILE_I_EXPR_PTR_TYPE ";\n"
> +"if (" COMPILE_I_PRINT_EXPR_TAKE_ADDRESS ")\n"
> +"\tmemcpy (" COMPILE_I_PRINT_OUT_ARG ", &" COMPILE_I_EXPR_VAL ",\n"
> + "sizeof (*" COMPILE_I_EXPR_PTR_TYPE "));\n"
> +"else\n"
> +"\tmemcpy (" COMPILE_I_PRINT_OUT_ARG ", " COMPILE_I_EXPR_VAL ",\n"
> + "sizeof (*" COMPILE_I_EXPR_PTR_TYPE "));\n"
> + , input, input);
This cannot work, when trying to print struct variable GCC fails for the
second memcpy() with:
gdb command line:7:2: error: cannot convert to a pointer type^M
It will need to perform two compilation steps (or just one if the first one is
the right kind).
Jan