summaryrefslogtreecommitdiff
path: root/ao-tools/ao-dbg
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2013-12-19 01:38:40 -0700
committerBdale Garbee <bdale@gag.com>2013-12-19 01:38:40 -0700
commit575bbaf976c5840fd0e308549c45a466fdec1352 (patch)
tree11bfb498348bf7687bffc24699c4b1a998988ee4 /ao-tools/ao-dbg
parentb825116df173b77e2cab217a7b76112c742f9279 (diff)
parentbc3610d8cecbfed40c62d4dcb93fc9a4d2a7c9e3 (diff)
Merge branch 'branch-1.3' into debian
Conflicts: ChangeLog altoslib/AltosRecordMM.java altosui/Makefile.am altosui/altos-windows.nsi.in configure.ac debian/changelog debian/control doc/Makefile doc/altusmetrum.xsl doc/release-notes-1.2.1.xsl doc/release-notes-1.2.xsl
Diffstat (limited to 'ao-tools/ao-dbg')
-rw-r--r--ao-tools/ao-dbg/Makefile.am2
-rw-r--r--ao-tools/ao-dbg/ao-dbg-command.c24
-rw-r--r--ao-tools/ao-dbg/ao-dbg-main.c11
-rw-r--r--ao-tools/ao-dbg/ao-dbg-parse.c2
4 files changed, 24 insertions, 15 deletions
diff --git a/ao-tools/ao-dbg/Makefile.am b/ao-tools/ao-dbg/Makefile.am
index ad2cb280..2c33cf06 100644
--- a/ao-tools/ao-dbg/Makefile.am
+++ b/ao-tools/ao-dbg/Makefile.am
@@ -7,6 +7,6 @@ man_MANS = ao-dbg.1
ao_dbg_DEPENDENCIES = $(AO_DBG_LIBS)
-ao_dbg_LDADD=$(AO_DBG_LIBS) $(LIBUSB_LIBS) -lreadline
+ao_dbg_LDADD=$(AO_DBG_LIBS) $(LIBUSB_LIBS) $(LIBREADLINE)
ao_dbg_SOURCES = ao-dbg-parse.c ao-dbg-command.c ao-dbg-main.c
diff --git a/ao-tools/ao-dbg/ao-dbg-command.c b/ao-tools/ao-dbg/ao-dbg-command.c
index eab7bc68..11c521e8 100644
--- a/ao-tools/ao-dbg/ao-dbg-command.c
+++ b/ao-tools/ao-dbg/ao-dbg-command.c
@@ -202,8 +202,8 @@ command_dump (int argc, char **argv)
enum command_result
command_file (int argc, char **argv)
{
- struct hex_file *hex;
- struct hex_image *image;
+ struct ao_hex_file *hex;
+ struct ao_hex_image *image;
FILE *file;
if (argc != 2)
@@ -211,16 +211,16 @@ command_file (int argc, char **argv)
file = fopen (argv[1], "r");
if (!file)
return command_error;
- hex = ccdbg_hex_file_read(file, argv[1]);
+ hex = ao_hex_file_read(file, argv[1]);
fclose(file);
if (!hex)
return command_error;
if (hex->nrecord == 0) {
- ccdbg_hex_file_free(hex);
+ ao_hex_file_free(hex);
return command_error;
}
- image = ccdbg_hex_image_create(hex);
- ccdbg_hex_file_free(hex);
+ image = ao_hex_image_create(hex);
+ ao_hex_file_free(hex);
start_address = image->address;
ccdbg_set_rom(s51_dbg, image);
return command_success;
@@ -495,8 +495,8 @@ command_load (int argc, char **argv)
{
char *filename = argv[1];
FILE *file;
- struct hex_file *hex;
- struct hex_image *image;
+ struct ao_hex_file *hex;
+ struct ao_hex_image *image;
if (!filename)
return command_error;
@@ -505,13 +505,13 @@ command_load (int argc, char **argv)
perror(filename);
return command_error;
}
- hex = ccdbg_hex_file_read(file, filename);
+ hex = ao_hex_file_read(file, filename);
fclose(file);
if (!hex) {
return command_error;
}
- image = ccdbg_hex_image_create(hex);
- ccdbg_hex_file_free(hex);
+ image = ao_hex_image_create(hex);
+ ao_hex_file_free(hex);
if (!image) {
fprintf(stderr, "image create failed\n");
return command_error;
@@ -523,7 +523,7 @@ command_load (int argc, char **argv)
} else {
fprintf(stderr, "Can only load to RAM\n");
}
- ccdbg_hex_image_free(image);
+ ao_hex_image_free(image);
return command_success;
}
diff --git a/ao-tools/ao-dbg/ao-dbg-main.c b/ao-tools/ao-dbg/ao-dbg-main.c
index 21b83a3d..25eca54b 100644
--- a/ao-tools/ao-dbg/ao-dbg-main.c
+++ b/ao-tools/ao-dbg/ao-dbg-main.c
@@ -16,6 +16,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "ao-dbg.h"
#include <unistd.h>
#include <sys/types.h>
@@ -204,13 +208,16 @@ s51_putc(int c)
putc(c, s51_output);
}
+#if HAVE_LIBREADLINE
#include <readline/readline.h>
#include <readline/history.h>
+#endif
int
s51_read_line(char *line, int len)
{
int ret;
+#if HAVE_LIBREADLINE
if (s51_output == stdout && s51_input == stdin && s51_prompt) {
char *r;
@@ -221,7 +228,9 @@ s51_read_line(char *line, int len)
line[len-1] = '\0';
add_history(r);
return 1;
- } else {
+ } else
+#endif
+ {
if (s51_prompt)
s51_printf("%s", s51_prompt);
else
diff --git a/ao-tools/ao-dbg/ao-dbg-parse.c b/ao-tools/ao-dbg/ao-dbg-parse.c
index dcb9099d..ba691834 100644
--- a/ao-tools/ao-dbg/ao-dbg-parse.c
+++ b/ao-tools/ao-dbg/ao-dbg-parse.c
@@ -198,7 +198,7 @@ command_read (void)
if (!s51_tty) {
if (!s51_device)
s51_device = getenv("AO_DBG_DEVICE");
- s51_tty = cc_usbdevs_find_by_arg(s51_device, "TIDongle");
+ s51_tty = cc_usbdevs_find_by_arg(s51_device, "TeleDongle");
}
s51_dbg = ccdbg_open (s51_tty);
if (!s51_dbg)