- open_file_from_path() now uses logging feature
- open_file_from_path() no longer uses paths for anything but "r" mode. Fixes
bug waiting to happen.
git-svn-id: svn://svn.berlios.de/openocd/trunk@389
b42882b7-edfa-0310-969c-
e2dbd0fdcd60
config_file_names[num_config_files] = NULL;
}
config_file_names[num_config_files] = NULL;
}
-FILE *open_file_from_path (command_context_t *cmd_ctx, char *file, char *mode)
+FILE *open_file_from_path (char *file, char *mode)
+ if (mode[0]!='r')
+ {
+ return fopen(file, mode);
+ } else
+ {
+
FILE *fp = NULL;
char **search_dirs = script_search_dirs;
char *dir;
FILE *fp = NULL;
char **search_dirs = script_search_dirs;
char *dir;
- command_print(cmd_ctx, "opened %s", full_path);
+ DEBUG("opened %s", full_path);
}
int parse_config_file(struct command_context_s *cmd_ctx)
}
int parse_config_file(struct command_context_s *cmd_ctx)
extern void add_config_file_name (const char *cfg);
extern void add_script_search_dir (const char *dir);
extern int configuration_output_handler(struct command_context_s *context, char* line);
extern void add_config_file_name (const char *cfg);
extern void add_script_search_dir (const char *dir);
extern int configuration_output_handler(struct command_context_s *context, char* line);
-extern FILE *open_file_from_path (command_context_t *cmd_ctx, char *file, char *mode);
+extern FILE *open_file_from_path (char *file, char *mode);
#endif /* CONFIGURATION_H */
#endif /* CONFIGURATION_H */
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
- script_file = open_file_from_path(cmd_ctx, args[0], "r");
+ script_file = open_file_from_path (args[0], "r");
if (f != NULL)
file = f + 1;
if (f != NULL)
file = f + 1;
- if (strchr(buffer, '\n')!=NULL)
+ if (strchr(string, '\n')!=NULL)
{
if (debug_level >= LOG_DEBUG)
{
{
if (debug_level >= LOG_DEBUG)
{
if (target->gdb_program_script)
{
if (target->gdb_program_script)
{
- script = open_file_from_path(cmd_ctx, target->gdb_program_script, "r");
+ script = open_file_from_path(target->gdb_program_script, "r");
if (!script)
{
ERROR("couldn't open script file %s", target->gdb_program_script);
if (!script)
{
ERROR("couldn't open script file %s", target->gdb_program_script);
{
target_unregister_event_callback(target_init_handler, priv);
{
target_unregister_event_callback(target_init_handler, priv);
- script = open_file_from_path(cmd_ctx, target->reset_script, "r");
+ script = open_file_from_path(target->reset_script, "r");
if (!script)
{
ERROR("couldn't open script file %s", target->reset_script);
if (!script)
{
ERROR("couldn't open script file %s", target->reset_script);
switch (target->reset_mode)
{
case RESET_HALT:
switch (target->reset_mode)
{
case RESET_HALT:
- command_print(cmd_ctx, "nSRST pulls nTRST, falling back to RESET_RUN_AND_HALT");
+ command_print(cmd_ctx, "nSRST pulls nTRST, falling back to \"reset run_and_halt\"");
target->reset_mode = RESET_RUN_AND_HALT;
break;
case RESET_INIT:
target->reset_mode = RESET_RUN_AND_HALT;
break;
case RESET_INIT:
- command_print(cmd_ctx, "nSRST pulls nTRST, falling back to RESET_RUN_AND_INIT");
+ command_print(cmd_ctx, "nSRST pulls nTRST, falling back to \"reset run_and_init\"");
target->reset_mode = RESET_RUN_AND_INIT;
break;
default:
target->reset_mode = RESET_RUN_AND_INIT;
break;
default:
{
int retval;
struct timeval timeout, now;
{
int retval;
struct timeval timeout, now;
gettimeofday(&timeout, NULL);
timeval_add_time(&timeout, 0, ms * 1000);
gettimeofday(&timeout, NULL);
timeval_add_time(&timeout, 0, ms * 1000);
- command_print(cmd_ctx, "waiting for target %s...", target_state_strings[state]);
+ if (once)
+ {
+ once=0;
+ command_print(cmd_ctx, "waiting for target %s...", target_state_strings[state]);
+ }
gettimeofday(&now, NULL);
if ((now.tv_sec > timeout.tv_sec) || ((now.tv_sec == timeout.tv_sec) && (now.tv_usec >= timeout.tv_usec)))
{
gettimeofday(&now, NULL);
if ((now.tv_sec > timeout.tv_sec) || ((now.tv_sec == timeout.tv_sec) && (now.tv_usec >= timeout.tv_usec)))
{
- command_print(cmd_ctx, "timed out while waiting for target %s", target_state_strings[state]);
ERROR("timed out while waiting for target %s", target_state_strings[state]);
break;
}
ERROR("timed out while waiting for target %s", target_state_strings[state]);
break;
}
if (image_open(&image, args[0], (argc >= 3) ? args[2] : NULL) != ERROR_OK)
{
if (image_open(&image, args[0], (argc >= 3) ? args[2] : NULL) != ERROR_OK)
{
- command_print(cmd_ctx, "load_image error: %s", image.error_str);
if (fileio_open(&fileio, args[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
{
if (fileio_open(&fileio, args[0], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
{
- command_print(cmd_ctx, "dump_image error: %s", fileio.error_str);
if (image_open(&image, args[0], (argc == 3) ? args[2] : NULL) != ERROR_OK)
{
if (image_open(&image, args[0], (argc == 3) ? args[2] : NULL) != ERROR_OK)
{
- command_print(cmd_ctx, "verify_image error: %s", image.error_str);
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)