When an interactive command fails, the Jim stack trace prints references to
the line in "command.c" where the interpreter was invoked. Since that
location has no relation to the actual command that failed, the information
serves only to add confusion.
By not adding the useless source info to Jim the noise can be reduced,
while still printing a useful trace for nested commands.
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Antonio Borneo [Fri, 18 Jun 2010 03:39:43 +0000 (11:39 +0800)]
helper/jim: review scope of symbols
Add "static" qualifier to private functions.
Function Jim_InterpolateTokens() is private, but has not
been changed to "static".
This function is called only once, so compiler inlines it.
After inline, there is a warning for variable uninitialized.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Freddie Chopin [Thu, 17 Jun 2010 18:30:23 +0000 (20:30 +0200)]
mingw32: -Wshadow fixes in arm-jtag-ew.c
(error: declaration of ‘stat’ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/sys/stat.h:279: error: shadowed declaration is here)
Freddie Chopin [Thu, 17 Jun 2010 18:26:48 +0000 (20:26 +0200)]
mingw32: -Wshadow fixes in rlink.c
(error: declaration of ‘byte’ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/rpcndr.h:50: error: shadowed declaration is here)
Freddie Chopin [Thu, 17 Jun 2010 18:06:28 +0000 (20:06 +0200)]
mingw32: -Wshadow fixes
in jim.c (error: declaration of ‘boolean’ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/rpcndr.h:52: error: shadowed declaration is here)
Antonio Borneo [Mon, 14 Jun 2010 04:22:10 +0000 (12:22 +0800)]
nor/at91sam3: replace helper membuf
Helper ./src/helper/membuf.c is only used in at91sam3.c
1) Replace membuf with LOG_*
2) The original code in sam3_GetDetails() invalidates
all the buffered output of sam3_GetInfo(). The new
code skips sam3_GetInfo() if its output should not
be printed.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Øyvind Harboe [Mon, 14 Jun 2010 10:08:46 +0000 (12:08 +0200)]
flash: fix bug in error propagation of flash write_image
when a write/unlock/erase failed during write_image, then
an error was not propagated back up so e.g. flash write
image from tcl scripts would not throw an exception.
Also flash filling speed was printed even when the
operation failed. Output is now less confusing.
Øyvind Harboe [Mon, 14 Jun 2010 07:30:37 +0000 (09:30 +0200)]
target: fix retval gaffe in mwX commands
failure to write to memory was not propagated.
This is an interesting case of broken error handling:
with exceptions we wouldn't have had this at all,
and I also wonder if there is a GCC option to warn
about these kinds of potential bugs.
Antonio Borneo [Sat, 12 Jun 2010 03:46:56 +0000 (11:46 +0800)]
TARGET: fix handling return code of MMU translation
Function armv4_5_mmu_translate_va() now properly signals
errors in the return value.
Remove former error handling by setting variable "type" to
value "-1".
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Sat, 12 Jun 2010 03:01:24 +0000 (11:01 +0800)]
TARGET/ARM920T: fix compile warning
Commit 0538081246fafbfb74d554bb1b758412534aa254
introduces a compile time warning:
arm920t.c: In function ‘arm920t_write_memory’:
arm920t.c:567: warning: ‘retval’ may be used uninitialized in this function
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Øyvind Harboe [Mon, 7 Jun 2010 13:14:04 +0000 (15:14 +0200)]
gdb-server: fix error reporting bugs
GDB and OpenOCD has two different error number
spaces and no mapping exists between them.
If a specific error number is to be reported
to GDB then this has to be done at the calling
site, rather than as a generic routine that
tries to map "retval" to GDB error number speak.
gcembed [Tue, 1 Jun 2010 11:48:22 +0000 (13:48 +0200)]
stm32 : change returned value of mass_erase function
Hello,
"stm32x mass_erase" return ERROR_OK even if something goes wrong.
Here is a summary of changes :
* in stm32x_mass_erase : return ERROR_FLASH_OPERATION_FAILED when error
detected in FLASH_SR register;
* in COMMAND_HANDLER(stm32x_handle_mass_erase_command) : return the
returned value of stm32x_mass_erase().
I don't know if there is reason to always return ERROR_OK ?
Spencer Oliver [Mon, 24 May 2010 11:30:29 +0000 (12:30 +0100)]
nor: add get_flash_bank_by_name autoprobe
When a flash cmd is called using the flash name the autoprobe
function is not called. autoprobe is called if flash_command_get_bank
falls through to get_flash_bank_by_num.
This makes both get_flash_bank_by_name and get_flash_bank_by_num
behave the same.
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Spencer Oliver [Mon, 24 May 2010 10:41:50 +0000 (11:41 +0100)]
flash: add virtual flash bank driver
This adds a virtual flash bank driver that allows virtual banks to
be defined that refer to an existing flash bank.
For example the real address for bank0 on the pic32 is 0x1fc00000
but the user program will either be in kseg0 (0xbfc00000) or
kseg1 (0x9fc00000).
This also means that gdb will be aware of all the read only flash
addresses.
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Antonio Borneo [Wed, 26 May 2010 02:04:03 +0000 (10:04 +0800)]
NOR/CFI: fix memory leak; check malloc return value
Every time command "flash probe #" is executed, memory
structures are re-allocated without preventive free()
of former areas, causing memory leak.
Also, memory allocation does not check return value,
determining segmentation fault in case of out of memory.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>