From bd186f2150452b4c6224fec991d63f7e20e4a3dc Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Thu, 8 Mar 2018 15:35:30 +0100 Subject: [PATCH 1/2] Partially revert 6ecd340886fa47c8a1993e1c6bee4bec4713561f to remove hardcoded paths Due to hardcoded GDB_ROOT and OCAML_ROOT, $CC was not able to find headers. Fixes #7 Signed-off-by: Justin Cinkelj --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5d6cea2..c659203 100644 --- a/Makefile +++ b/Makefile @@ -30,10 +30,10 @@ # Building libmonda requires a PIC-enabled OCaml toolchain (configure # with -fPIC). -#GDB_ROOT=$(PREFIX)/libexec/gdb-ocaml.7.11/src -#OCAML_ROOT=$(PREFIX) -GDB_ROOT=/mnt/local/sda1/mshinwell/mshinwell-gdb -OCAML_ROOT=/mnt/local/sda1/mshinwell/mshinwell-ocaml2-install +GDB_ROOT=$(PREFIX)/libexec/gdb-ocaml.7.11/src +OCAML_ROOT=$(PREFIX) +#GDB_ROOT=/mnt/local/sda1/mshinwell/mshinwell-gdb +#OCAML_ROOT=/mnt/local/sda1/mshinwell/mshinwell-ocaml2-install OCAMLOPT=$(OCAML_ROOT)/bin/ocamlopt -verbose -I +compiler-libs -I ./src \ -g -fPIC -I ./gdb_backend From 3563a8e632e17327620010ca5af8a0d0dbc13f8f Mon Sep 17 00:00:00 2001 From: Justin Cinkelj Date: Thu, 8 Mar 2018 15:53:52 +0100 Subject: [PATCH 2/2] Include missing headers, fix call to c_val_print Add to gdb_backend/to_gdb.c stack.h for iterate_over_block_local_vars() target/target.h for target_read_memory() Add to gdb_backedn/from_gdb.c value.h for value_lval_const(), value_bits_synthetic_pointer() c-lang.h for c_val_print() Func c_val_print() was called with 9 parameters, but declaration in c-lang.h has only 8: extern void c_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); I guess the last (depth) param is excessive, so it was removed that one. Signed-off-by: Justin Cinkelj --- gdb_backend/from_gdb.c | 6 ++++-- gdb_backend/to_gdb.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gdb_backend/from_gdb.c b/gdb_backend/from_gdb.c index 3d8fb29..75c0894 100644 --- a/gdb_backend/from_gdb.c +++ b/gdb_backend/from_gdb.c @@ -42,6 +42,8 @@ #include "stack.h" #include "symtab.h" #include "valprint.h" +#include "value.h" +#include "c-lang.h" #include #include @@ -124,7 +126,7 @@ monda_val_print (struct type* type, const gdb_byte* valaddr, fflush(stderr); */ c_val_print(type, valaddr, embedded_offset, address, stream, recurse, - val, options, depth); + val, options/*, depth*/); } else #endif @@ -157,7 +159,7 @@ monda_val_print (struct type* type, const gdb_byte* valaddr, fflush(stderr); */ c_val_print(type, valaddr, embedded_offset, address, stream, recurse, - val, options, depth); + val, options/*, depth*/); } } } diff --git a/gdb_backend/to_gdb.c b/gdb_backend/to_gdb.c index 3b33ada..749c1d1 100644 --- a/gdb_backend/to_gdb.c +++ b/gdb_backend/to_gdb.c @@ -35,6 +35,8 @@ #include "defs.h" #include "symtab.h" #include "value.h" +#include "stack.h" +#include "target/target.h" /* Remember: No gdb exceptions may escape from the functions called from OCaml in this file. (See from_gdb.c for an explanation.)