From df5ed829172d366a7917e522758805b5ffb6e645 Mon Sep 17 00:00:00 2001 From: Evgeny Cherkashin Date: Fri, 13 Sep 2013 16:06:13 +0900 Subject: [PATCH 1/3] Explained the experience of the debugger run in EMACS. --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README b/README index 4a126c4..730add8 100644 --- a/README +++ b/README @@ -19,3 +19,18 @@ If the program contains no EMBED_BREAKPOINT statements, you will get an error li Depends on: GNU toolchain, BFD, Linux /proc On Debian or Ubuntu: apt-get install binutils-dev + +The program ./gdb-with-breakpoints can even be used in EMACS debugger. +To invoke it type M-x gdb, then change + + gdb -i=mi + +to + + ./gdb-with-breakpoints -i=mi + +That is in our example case: + + ./gdb-with-breakpoints -i=mi example + +You will get a buffer of the program source with breakpoints marked. From 32ccaf2997520083186aeb1df1ce0524092a9990 Mon Sep 17 00:00:00 2001 From: Evgeny Cherkashin Date: Fri, 13 Sep 2013 16:08:26 +0900 Subject: [PATCH 2/3] My experience of compiling and linking the wrapper. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 1fbd7b3..bdac5b2 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/sh -xe -gcc -Wall -std=c99 -lbfd -o gdb-with-breakpoints gdb-with-breakpoints.c +gcc -Wall -std=c99 -o gdb-with-breakpoints gdb-with-breakpoints.c -lssl -lbfd -ldl -lz -liberty gcc -Wall -g -o example example.c From 6b845ceb4a3f70eb07c1c0659c5918a7f3af8b44 Mon Sep 17 00:00:00 2001 From: Evgeny Cherkashin Date: Fri, 13 Sep 2013 16:10:31 +0900 Subject: [PATCH 3/3] BFD requires the macro be defined. --- gdb-with-breakpoints.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb-with-breakpoints.c b/gdb-with-breakpoints.c index 40d62f1..eba2614 100644 --- a/gdb-with-breakpoints.c +++ b/gdb-with-breakpoints.c @@ -2,6 +2,9 @@ #include #include #include +#if !defined PACKAGE && !defined PACKAGE_VERSION +#define PACKAGE "gdb-with-breakpoints" +#endif #include