Hi, On Mon, Jan 19, 2009 at 04:55:25PM -0800, Rick Altherr wrote: > The value of -d is certainly not cached between invocations of OpenOCD. > It can be overridden in a config file with the debug_level command, > however. openocd.cfg is run after command line arguments. -f evaluates > the specified file at that position in the argument parsing.
I did a few more tests and the -d behaviour is still a bit strange IMO. $ openocd -f /usr/lib/openocd/interface/dummy.cfg Open On-Chip Debugger 1.0 (2008-12-28-15:04) svn:exported BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ Error: There are no enabled taps? Error: There are no enabled taps? Warn : no telnet port specified, using default port 4444 Warn : no gdb ports allocated as no target has been specified Warn : no tcl port specified, using default port 6666 $ openocd -d 0 -f /usr/lib/openocd/interface/dummy.cfg Open On-Chip Debugger 1.0 (2008-12-28-15:04) svn:exported BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ User : 5 2 command.c:494 command_run_line(): Debug: 6 2 configuration.c:88 find_file(): found /usr/lib/openocd/interface/dummy.cfg Debug: 8 3 command.c:91 script_command(): script_command - interface Debug: 9 3 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 10 3 command.c:108 script_command(): script_command - interface, argv[1]=dummy User : 11 3 command.c:494 command_run_line(): Debug: 13 3 command.c:91 script_command(): script_command - init Debug: 14 3 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 15 3 openocd.c:151 handle_init_command(): target init complete Debug: 16 4 openocd.c:158 handle_init_command(): jtag interface init complete Debug: 17 4 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 18 4 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 19 4 jtag.c:2234 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / RESET Debug: 20 4 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 21 4 jtag.c:1157 jtag_add_reset(): JTAG reset with RESET instead of TRST Debug: 22 4 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 23 4 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 24 4 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 25 4 dummy.c:103 dummy_reset(): reset to RESET Debug: 26 4 dummy.c:103 dummy_reset(): reset to RESET Debug: 27 4 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 28 4 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 29 4 openocd.c:173 handle_init_command(): flash init complete Debug: 30 4 openocd.c:177 handle_init_command(): mflash init complete Debug: 31 4 openocd.c:181 handle_init_command(): NAND init complete Debug: 32 4 openocd.c:185 handle_init_command(): pld init complete Warn : 33 4 telnet_server.c:612 telnet_init(): no telnet port specified, using default port 4444 Warn : 34 5 gdb_server.c:2195 gdb_init(): no gdb ports allocated as no target has been specified Warn : 35 5 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666 User : 36 5 command.c:494 command_run_line(): $ openocd -d 3 -f /usr/lib/openocd/interface/dummy.cfg Open On-Chip Debugger 1.0 (2008-12-28-15:04) svn:exported BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ User : 5 11 command.c:494 command_run_line(): Debug: 6 11 configuration.c:88 find_file(): found /usr/lib/openocd/interface/dummy.cfg Debug: 8 12 command.c:91 script_command(): script_command - interface Debug: 9 12 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 10 12 command.c:108 script_command(): script_command - interface, argv[1]=dummy User : 11 12 command.c:494 command_run_line(): Debug: 13 12 command.c:91 script_command(): script_command - init Debug: 14 12 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 15 12 openocd.c:151 handle_init_command(): target init complete Debug: 16 12 openocd.c:158 handle_init_command(): jtag interface init complete Debug: 17 12 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 18 13 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 19 13 jtag.c:2234 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / RESET Debug: 20 13 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 21 13 jtag.c:1157 jtag_add_reset(): JTAG reset with RESET instead of TRST Debug: 22 13 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 23 13 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 24 13 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 25 13 dummy.c:103 dummy_reset(): reset to RESET Debug: 26 13 dummy.c:103 dummy_reset(): reset to RESET Debug: 27 13 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 28 13 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 29 13 openocd.c:173 handle_init_command(): flash init complete Debug: 30 13 openocd.c:177 handle_init_command(): mflash init complete Debug: 31 13 openocd.c:181 handle_init_command(): NAND init complete Debug: 32 13 openocd.c:185 handle_init_command(): pld init complete Warn : 33 13 telnet_server.c:612 telnet_init(): no telnet port specified, using default port 4444 Warn : 34 13 gdb_server.c:2195 gdb_init(): no gdb ports allocated as no target has been specified Warn : 35 14 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666 User : 36 14 command.c:494 command_run_line(): $ openocd -f /usr/lib/openocd/interface/dummy.cfg -d 0 Open On-Chip Debugger 1.0 (2008-12-28-15:04) svn:exported BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ User : 5 0 command.c:494 command_run_line(): Debug: 6 1 configuration.c:88 find_file(): found /usr/lib/openocd/interface/dummy.cfg Debug: 8 1 command.c:91 script_command(): script_command - interface Debug: 9 2 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 10 2 command.c:108 script_command(): script_command - interface, argv[1]=dummy User : 11 2 command.c:494 command_run_line(): Debug: 13 2 command.c:91 script_command(): script_command - init Debug: 14 2 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 15 2 openocd.c:151 handle_init_command(): target init complete Debug: 16 2 openocd.c:158 handle_init_command(): jtag interface init complete Debug: 17 2 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 18 2 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 19 2 jtag.c:2234 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / RESET Debug: 20 2 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 21 2 jtag.c:1157 jtag_add_reset(): JTAG reset with RESET instead of TRST Debug: 22 2 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 23 2 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 24 2 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 25 2 dummy.c:103 dummy_reset(): reset to RESET Debug: 26 3 dummy.c:103 dummy_reset(): reset to RESET Debug: 27 3 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 28 3 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 29 3 openocd.c:173 handle_init_command(): flash init complete Debug: 30 3 openocd.c:177 handle_init_command(): mflash init complete Debug: 31 3 openocd.c:181 handle_init_command(): NAND init complete Debug: 32 3 openocd.c:185 handle_init_command(): pld init complete Warn : 33 3 telnet_server.c:612 telnet_init(): no telnet port specified, using default port 4444 Warn : 34 3 gdb_server.c:2195 gdb_init(): no gdb ports allocated as no target has been specified Warn : 35 3 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666 User : 36 3 command.c:494 command_run_line(): $ openocd -f /usr/lib/openocd/interface/dummy.cfg -d 3 Open On-Chip Debugger 1.0 (2008-12-28-15:04) svn:exported BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ User : 5 1 command.c:494 command_run_line(): Debug: 6 1 configuration.c:88 find_file(): found /usr/lib/openocd/interface/dummy.cfg Debug: 8 2 command.c:91 script_command(): script_command - interface Debug: 9 2 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 10 2 command.c:108 script_command(): script_command - interface, argv[1]=dummy User : 11 2 command.c:494 command_run_line(): Debug: 13 2 command.c:91 script_command(): script_command - init Debug: 14 2 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 15 2 openocd.c:151 handle_init_command(): target init complete Debug: 16 2 openocd.c:158 handle_init_command(): jtag interface init complete Debug: 17 2 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 18 2 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 19 2 jtag.c:2234 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / RESET Debug: 20 3 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 21 3 jtag.c:1157 jtag_add_reset(): JTAG reset with RESET instead of TRST Debug: 22 3 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 23 3 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 24 3 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 25 3 dummy.c:103 dummy_reset(): reset to RESET Debug: 26 3 dummy.c:103 dummy_reset(): reset to RESET Debug: 27 3 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 28 3 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 29 3 openocd.c:173 handle_init_command(): flash init complete Debug: 30 3 openocd.c:177 handle_init_command(): mflash init complete Debug: 31 3 openocd.c:181 handle_init_command(): NAND init complete Debug: 32 3 openocd.c:185 handle_init_command(): pld init complete Warn : 33 3 telnet_server.c:612 telnet_init(): no telnet port specified, using default port 4444 Warn : 34 3 gdb_server.c:2195 gdb_init(): no gdb ports allocated as no target has been specified Warn : 35 3 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666 User : 36 4 command.c:494 command_run_line(): $ openocd -d -f /usr/lib/openocd/interface/dummy.cfg Open On-Chip Debugger 1.0 (2008-12-28-15:04) svn:exported BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ User : 5 1 command.c:494 command_run_line(): Debug: 6 1 configuration.c:88 find_file(): found /usr/lib/openocd/interface/dummy.cfg Debug: 8 2 command.c:91 script_command(): script_command - interface Debug: 9 2 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 10 2 command.c:108 script_command(): script_command - interface, argv[1]=dummy User : 11 2 command.c:494 command_run_line(): Debug: 13 2 command.c:91 script_command(): script_command - init Debug: 14 2 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 15 2 openocd.c:151 handle_init_command(): target init complete Debug: 16 2 openocd.c:158 handle_init_command(): jtag interface init complete Debug: 17 2 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 18 2 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 19 3 jtag.c:2234 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / RESET Debug: 20 3 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 21 3 jtag.c:1157 jtag_add_reset(): JTAG reset with RESET instead of TRST Debug: 22 3 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 23 3 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 24 3 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 25 3 dummy.c:103 dummy_reset(): reset to RESET Debug: 26 3 dummy.c:103 dummy_reset(): reset to RESET Debug: 27 3 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 28 3 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 29 3 openocd.c:173 handle_init_command(): flash init complete Debug: 30 3 openocd.c:177 handle_init_command(): mflash init complete Debug: 31 3 openocd.c:181 handle_init_command(): NAND init complete Debug: 32 3 openocd.c:185 handle_init_command(): pld init complete Warn : 33 3 telnet_server.c:612 telnet_init(): no telnet port specified, using default port 4444 Warn : 34 3 gdb_server.c:2195 gdb_init(): no gdb ports allocated as no target has been specified Warn : 35 4 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666 User : 36 4 command.c:494 command_run_line(): $ openocd -f /usr/lib/openocd/interface/dummy.cfg -d Open On-Chip Debugger 1.0 (2008-12-28-15:04) svn:exported BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ User : 5 1 command.c:494 command_run_line(): Debug: 6 1 configuration.c:88 find_file(): found /usr/lib/openocd/interface/dummy.cfg Debug: 8 2 command.c:91 script_command(): script_command - interface Debug: 9 2 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 10 2 command.c:108 script_command(): script_command - interface, argv[1]=dummy User : 11 2 command.c:494 command_run_line(): Debug: 13 2 command.c:91 script_command(): script_command - init Debug: 14 2 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 15 2 openocd.c:151 handle_init_command(): target init complete Debug: 16 2 openocd.c:158 handle_init_command(): jtag interface init complete Debug: 17 2 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 18 3 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 19 3 jtag.c:2234 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / RESET Debug: 20 3 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 21 3 jtag.c:1157 jtag_add_reset(): JTAG reset with RESET instead of TRST Debug: 22 3 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 23 3 jtag.c:434 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 24 3 jtag.c:1150 jtag_add_reset(): SRST line released Debug: 25 3 dummy.c:103 dummy_reset(): reset to RESET Debug: 26 3 dummy.c:103 dummy_reset(): reset to RESET Debug: 27 3 jtag.c:2201 jtag_init_inner(): Init JTAG chain Error: 28 3 jtag.c:2205 jtag_init_inner(): There are no enabled taps? Debug: 29 3 openocd.c:173 handle_init_command(): flash init complete Debug: 30 3 openocd.c:177 handle_init_command(): mflash init complete Debug: 31 3 openocd.c:181 handle_init_command(): NAND init complete Debug: 32 3 openocd.c:185 handle_init_command(): pld init complete Warn : 33 3 telnet_server.c:612 telnet_init(): no telnet port specified, using default port 4444 Warn : 34 4 gdb_server.c:2195 gdb_init(): no gdb ports allocated as no target has been specified Warn : 35 4 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666 User : 36 4 command.c:494 command_run_line(): As you can see, it doesn't matter if I use "-d 0" or "-d 3", the code always does full debugging output. It also doesn't matter if I put the -d option at the beginning or end of the command line. And using -d only (without a digit argument) seems to assume "-d 3", not sure if that is intentional (I wouldn't consider it a bug though). Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
