On Thu, Jun 18, 2015 at 2:33 PM, Doug Evans <dje@google.com> wrote:
> [sorry for the repost, typo in email address]
>
> Hi.
>
> This patch updates the generator so that the next time
> the files are generated we don't lose the TRACE_{EXTRACT,RESULT}
> renaming change.
>
> ref:
> https://sourceware.org/ml/gdb-patches/2015-06/msg00280.html
>
> Tested with:
>
> 1) put guile 1.8.8 in $PATH
>
> 2) apply this patch:
>
> https://sourceware.org/ml/gdb-patches/2015-06/msg00395.html
>
> 3)
>
> bash$ $src/configure --prefix=$(pwd)/rel \
> --enable-cgen-maint \
> --enable-targets=all \
> --enable-sim
> bash$ make all-sim
Darn, I wanted these steps to be complete.
Missed a step, so let me try again.
1) put guile 1.8.8 in $PATH
[no special configure options are needed, just --prefix]
2) check out cgen
bash$ cd /place/to/put/cgen
bash$ cvs -d :pserver:anoncvs@sourceware.org:/cvs/src co cgen
2b) make sure the build can find it
bash$ ln -s $(pwd)/src/cgen $git/cgen
There's a TODO to be able to specify the path to cgen
when configuring binutils,gdb.
I've always just done this hack when I need it.
3) apply this patch
https://sourceware.org/ml/gdb-patches/2015-06/msg00395.html
4) Build all the sims.
Generated files that need regenerating will be,
including the opcodes files.
bash$ cd $build
bash$ $git/configure --prefix=$(pwd)/rel \
--enable-cgen-maint \
--enable-targets=all \
--enable-sim
bash$ make all-sim
If/when some form of (3) gets applied, and the TODO is done,
the steps should be simple enough.
Heads up, if you try this today there are two other outstanding patches
to cgen that affect the generated files.
===================================================================
RCS file: /cvs/src/src/cgen/rtl-c.scm,v
retrieving revision 1.33
@@ -544,7 +544,7 @@
(rtl-c-get estate mode src))))
)
-; Same as rtl-c-set-quiet except also print TRACE_RESULT message.
+; Same as rtl-c-set-quiet except also print CGEN_TRACE_RESULT message.
; MODE is either a <mode> object or the mode name.
; ??? One possible change is to defer the (rtl-c-get src) call to dest's
; set handler. Such sources would be marked accordingly and rtl-c-get
===================================================================
RCS file: /cvs/src/src/cgen/sim-cpu.scm,v
retrieving revision 1.19
@@ -1090,8 +1090,8 @@ CGEN_ATTR_VALUE (NULL, abuf->idesc->attr
FAST_P, when desired, is defined on the command line, -DFAST_P=1. */
#if FAST_P
#define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
-#undef TRACE_RESULT
-#define TRACE_RESULT(cpu, abuf, name, type, val)
+#undef CGEN_TRACE_RESULT
+#define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
#else
#define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
#endif
@@ -1183,13 +1183,13 @@ CGEN_ATTR_VALUE (NULL, abuf->idesc->attr
/* If hyper-fast [well not unnecessarily slow] execution is selected, turn
off frills like tracing and profiling. */
-/* FIXME: A better way would be to have TRACE_RESULT check for something
+/* FIXME: A better way would be to have CGEN_TRACE_RESULT check for
something
that can cause it to be optimized out. Another way would be to emit
special handlers into the instruction \"stream\". */
#if FAST_P
-#undef TRACE_RESULT
-#define TRACE_RESULT(cpu, abuf, name, type, val)
+#undef CGEN_TRACE_RESULT
+#define CGEN_TRACE_RESULT(cpu, abuf, name, type, val)
#endif
#undef GET_ATTR
===================================================================
RCS file: /cvs/src/src/cgen/sim-decode.scm,v
retrieving revision 1.17
@@ -241,7 +241,7 @@ void
)
; gen-trace-extract method.
-; Return appropriate arguments for TRACE_EXTRACT.
+; Return appropriate arguments for CGEN_TRACE_EXTRACT.
(method-make!
<hardware-base> 'gen-trace-extract
@@ -266,7 +266,7 @@ void
""))
)
-; Return appropriate arguments for TRACE_EXTRACT.
+; Return appropriate arguments for CGEN_TRACE_EXTRACT.
(method-make!
<hw-register> 'gen-trace-extract
@@ -294,7 +294,7 @@ void
";\n"))
)
-; Return appropriate arguments for TRACE_EXTRACT.
+; Return appropriate arguments for CGEN_TRACE_EXTRACT.
(method-make!
<hw-address> 'gen-trace-extract
@@ -320,7 +320,7 @@ void
(send (op:type op) 'gen-extract op sfmt local?)
)
-; Return three of arguments to TRACE_EXTRACT:
+; Return three of arguments to CGEN_TRACE_EXTRACT:
; string argument to fprintf, character indicating type of third arg,
value.
; The type is one of: x.
@@ -374,7 +374,7 @@ void
iflds)
(string-list-map (lambda (op) (/gen-op-extract op sfmt #f))
operands)
- " TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "
+ " CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "
"\"" (gen-sym sfmt) "\""
(string-list-map (lambda (f) (/gen-trace-argbuf-ifld f sfmt))
iflds)
===================================================================
RCS file: /cvs/src/src/cgen/sim.scm,v
retrieving revision 1.32
@@ -1260,12 +1260,12 @@
(send (op:type op) 'gen-set-quiet estate mode index selector
(cx:make-with-atlist mode "opval" (cx:atlist newval))))
(/op-gen-written-update op)
-; TRACE_RESULT_<MODE> (cpu, abuf, hwnum, opnum, value);
+; CGEN_TRACE_RESULT_<MODE> (cpu, abuf, hwnum, opnum, value);
; For each insn record array of operand numbers [or indices into
; operand instance table].
; Could just scan the operand table for the operand or hardware number,
; assuming the operand number is stored in `op'.
- " TRACE_RESULT (current_cpu, abuf"
+ " CGEN_TRACE_RESULT (current_cpu, abuf"
", " (send op 'gen-pretty-name mode)
", " (mode:printf-type mode)
", opval);\n"
@@ -1287,12 +1287,12 @@
" " /par-operand-macro " (" (gen-sym op) ")"
" = opval;\n"))
(/op-gen-written-update op)
-; TRACE_RESULT_<MODE> (cpu, abuf, hwnum, opnum, value);
+; CGEN_TRACE_RESULT_<MODE> (cpu, abuf, hwnum, opnum, value);
; For each insn record array of operand numbers [or indices into
; operand instance table].
; Could just scan the operand table for the operand or hardware number,
; assuming the operand number is stored in `op'.
- " TRACE_RESULT (current_cpu, abuf"
+ " CGEN_TRACE_RESULT (current_cpu, abuf"
", " (send op 'gen-pretty-name mode)
", " (mode:printf-type mode)
", opval);\n"
@@ -1323,7 +1323,8 @@
(/op-gen-set-quiet self estate mode index selector newval)))))
)
-; Return C code to set the value of an operand and print TRACE_RESULT
message.
+; Return C code to set the value of an operand and print CGEN_TRACE_RESULT
+; message.
; NEWVAL is a <c-expr> object of the value to store.
; If INDEX is non-#f use it, otherwise use (op:index self).