From: David B. <dbr...@us...> - 2009-12-26 20:27:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3a84436afb8e1deddffac079573325c6ec3463df (commit) via e7f81c11c9da8bbe46ca953f41809811b0f47639 (commit) via df58812b528c9b7857d8bde8f3eea4ad46ed034f (commit) via 396b0f3012955f21d7932d958fc7547532cdc90a (commit) via 08a890e4aae307d874bd617f4dc742a56f2064a2 (commit) from f9d203d1e6656041affc09528ac373a2b32497ee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3a84436afb8e1deddffac079573325c6ec3463df Author: David Brownell <dbr...@us...> Date: Sat Dec 26 11:25:44 2009 -0800 ARM: add comment re register exports Modern versions of GDB can understand VFP3 and iwMMXt hardware. diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 593e895..424263d 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1686,6 +1686,7 @@ struct target_type cortexa8_target = { .deassert_reset = cortex_a8_deassert_reset, .soft_reset_halt = NULL, + /* REVISIT allow exporting VFP3 registers ... */ .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = cortex_a8_read_memory, diff --git a/src/target/xscale.c b/src/target/xscale.c index f1afc71..6efe59c 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -3731,6 +3731,7 @@ struct target_type xscale_target = .deassert_reset = xscale_deassert_reset, .soft_reset_halt = NULL, + /* REVISIT on some cores, allow exporting iwmmxt registers ... */ .get_gdb_reg_list = arm_get_gdb_reg_list, .read_memory = xscale_read_memory, commit e7f81c11c9da8bbe46ca953f41809811b0f47639 Author: David Brownell <dbr...@us...> Date: Sat Dec 26 10:35:24 2009 -0800 User's Guide: update GDB info Advise leaving background polling enabled; fix broken URL; add simple program startup example. diff --git a/doc/openocd.texi b/doc/openocd.texi index 4244a1e..013a31a 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -1805,6 +1805,7 @@ allows background polling to be enabled and disabled. You could use this from the TCL command shell, or from GDB using @command{monitor poll} command. +Leave background polling enabled while you're using GDB. @example > poll background polling: on @@ -6572,8 +6573,8 @@ if that's the tool chain used to compile your code. @cindex Connecting to GDB Use GDB 6.7 or newer with OpenOCD if you run into trouble. For instance GDB 6.3 has a known bug that produces bogus memory access -errors, which has since been fixed: look up 1836 in -@url{http://sourceware.org/cgi-bin/gnatsweb.pl?database=gdb} +errors, which has since been fixed; see +@url{http://osdir.com/ml/gdb.bugs.discuss/2004-12/msg00018.html} OpenOCD can communicate with GDB in two ways: @@ -6597,6 +6598,38 @@ session. To list the available OpenOCD commands type @command{monitor help} on the GDB command line. +@section Sample GDB session startup + +With the remote protocol, GDB sessions start a little differently +than they do when you're debugging locally. +Here's an examples showing how to start a debug session with a +small ARM program. +In this case the program was linked to be loaded into SRAM on a Cortex-M3. +Most programs would be written into flash (address 0) and run from there. + +@example +$ arm-none-eabi-gdb example.elf +(gdb) target remote localhost:3333 +Remote debugging using localhost:3333 +... +(gdb) monitor reset halt +... +(gdb) load +Loading section .vectors, size 0x100 lma 0x20000000 +Loading section .text, size 0x5a0 lma 0x20000100 +Loading section .data, size 0x18 lma 0x200006a0 +Start address 0x2000061c, load size 1720 +Transfer rate: 22 KB/sec, 573 bytes/write. +(gdb) continue +Continuing. +... +@end example + +You could then interrupt the GDB session to make the program break, +type @command{where} to show the stack, @command{list} to show the +code around the program counter, @command{step} through code, +set breakpoints or watchpoints, and so on. + @section Configuring GDB for OpenOCD OpenOCD supports the gdb @option{qSupported} packet, this enables information commit df58812b528c9b7857d8bde8f3eea4ad46ed034f Author: David Brownell <dbr...@us...> Date: Sat Dec 26 10:24:39 2009 -0800 NOR: messaging fix Fix syntax error: default to "wrote N bytes"; writing a single byte is an unusual case, not the normal one. diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index b5e1b2c..1097bdf 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -439,7 +439,7 @@ COMMAND_HANDLER(handle_flash_write_image_command) if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) { - command_print(CMD_CTX, "wrote %" PRIu32 " byte from file %s " + command_print(CMD_CTX, "wrote %" PRIu32 " bytes from file %s " "in %fs (%0.3f kb/s)", written, CMD_ARGV[0], duration_elapsed(&bench), duration_kbps(&bench, written)); } @@ -625,7 +625,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) { - command_print(CMD_CTX, "wrote %zu byte from file %s to flash bank %u" + command_print(CMD_CTX, "wrote %zu bytes from file %s to flash bank %u" " at offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)", fileio.size, CMD_ARGV[1], p->bank_number, offset, duration_elapsed(&bench), duration_kbps(&bench, fileio.size)); commit 396b0f3012955f21d7932d958fc7547532cdc90a Author: David Brownell <dbr...@us...> Date: Sat Dec 26 10:22:28 2009 -0800 NOR: Allocate the right amount of memory Switch to calloc() to simplify review and initialization. diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index 67fd78b..fe5372b 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -401,7 +401,7 @@ int flash_write_unlock(struct target *target, struct image *image, } /* allocate padding array */ - padding = malloc(image->num_sections * sizeof(padding)); + padding = calloc(image->num_sections, sizeof(*padding)); /* loop until we reach end of the image */ while (section < image->num_sections) commit 08a890e4aae307d874bd617f4dc742a56f2064a2 Author: David Brownell <dbr...@us...> Date: Sat Dec 26 10:19:19 2009 -0800 cygwin 1.7 build fixes It's less accepting of signed char ... insisting that e.g. tolower() not receive one as a parameter. It's probably good to phase out such usage, given the number of bugs that lurk in the vicinity (assumptions that char is unsigned), so fix these even though such usage is actually legal. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 123d61c..5c8ca8c 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -1345,7 +1345,8 @@ COMMAND_HANDLER(mg_bank_cmd) char *str; mflash_bank->rst_pin.num = strtoul(CMD_ARGV[2], &str, 0); if (*str) - mflash_bank->rst_pin.port[0] = (uint16_t)tolower(str[0]); + mflash_bank->rst_pin.port[0] = (uint16_t) + tolower((unsigned)str[0]); mflash_bank->target = target; diff --git a/src/helper/jim.c b/src/helper/jim.c index c04acf0..53d1a75 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -2217,7 +2217,7 @@ static Jim_Obj *JimStringToLower(Jim_Interp *interp, Jim_Obj *strObjPtr) memcpy(buf, strObjPtr->bytes, strObjPtr->length + 1); for (i = 0; i < strObjPtr->length; i++) - buf[i] = tolower(buf[i]); + buf[i] = tolower((unsigned)buf[i]); return Jim_NewStringObjNoAlloc(interp, buf, strObjPtr->length); } @@ -2233,7 +2233,7 @@ static Jim_Obj *JimStringToUpper(Jim_Interp *interp, Jim_Obj *strObjPtr) memcpy(buf, strObjPtr->bytes, strObjPtr->length + 1); for (i = 0; i < strObjPtr->length; i++) - buf[i] = toupper(buf[i]); + buf[i] = toupper((unsigned)buf[i]); return Jim_NewStringObjNoAlloc(interp, buf, strObjPtr->length); } @@ -2347,7 +2347,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, case '8': case '9': accum = 0; - while (isdigit(*fmt) && (fmtLen > 0)) { + while (isdigit((unsigned)*fmt) && (fmtLen > 0)) { accum = (accum * 10) + (*fmt - '0'); fmt++; fmtLen--; } diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 8798ae0..cf62864 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -943,7 +943,7 @@ void gdb_str_to_target(struct target *target, char *tstr, struct reg *reg) } } -static int hextoint(char c) +static int hextoint(int c) { if (c>='0'&&c<='9') { diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c index 0824768..a772c0a 100644 --- a/src/server/tcl_server.c +++ b/src/server/tcl_server.c @@ -88,7 +88,7 @@ static int tcl_input(struct connection *connection) const char *result; int reslen; struct tcl_connection *tclc; - char in[256]; + unsigned char in[256]; rlen = read_socket(connection->fd, &in, sizeof(in)); if (rlen <= 0) { diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 929c1c1..92e7480 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -195,8 +195,8 @@ void telnet_clear_line(struct connection *connection, struct telnet_connection * int telnet_input(struct connection *connection) { int bytes_read; - char buffer[TELNET_BUFFER_SIZE]; - char *buf_p; + unsigned char buffer[TELNET_BUFFER_SIZE]; + unsigned char *buf_p; struct telnet_connection *t_con = connection->priv; struct command_context *command_context = connection->cmd_ctx; @@ -216,7 +216,7 @@ int telnet_input(struct connection *connection) switch (t_con->state) { case TELNET_STATE_DATA: - if (*buf_p == '\xff') + if (*buf_p == 0xff) { t_con->state = TELNET_STATE_IAC; } @@ -395,16 +395,16 @@ int telnet_input(struct connection *connection) case TELNET_STATE_IAC: switch (*buf_p) { - case '\xfe': + case 0xfe: t_con->state = TELNET_STATE_DONT; break; - case '\xfd': + case 0xfd: t_con->state = TELNET_STATE_DO; break; - case '\xfc': + case 0xfc: t_con->state = TELNET_STATE_WONT; break; - case '\xfb': + case 0xfb: t_con->state = TELNET_STATE_WILL; break; } diff --git a/src/svf/svf.c b/src/svf/svf.c index 1c746f3..dfdecbc 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -470,7 +470,8 @@ free_all: #define SVFP_CMD_INC_CNT 1024 static int svf_read_command_from_file(int fd) { - char ch, *tmp_buffer = NULL; + unsigned char ch; + char *tmp_buffer = NULL; int cmd_pos = 0, cmd_ok = 0, slash = 0, comment = 0; while (!cmd_ok && (read(fd, &ch, 1) > 0)) ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 37 +++++++++++++++++++++++++++++++++++-- src/flash/mflash.c | 3 ++- src/flash/nor/core.c | 2 +- src/flash/nor/tcl.c | 4 ++-- src/helper/jim.c | 6 +++--- src/server/gdb_server.c | 2 +- src/server/tcl_server.c | 2 +- src/server/telnet_server.c | 14 +++++++------- src/svf/svf.c | 3 ++- src/target/cortex_a8.c | 1 + src/target/xscale.c | 1 + 11 files changed, 56 insertions(+), 19 deletions(-) hooks/post-receive -- Main OpenOCD repository |