command: Log the failed command by full name
[openocd.git] / src / helper / command.c
index 48d998f..1ff4e01 100644 (file)
@@ -642,7 +642,10 @@ static int run_command(struct command_context *context,
                /* we do not print out an error message because the command *should*
                 * have printed out an error
                 */
-               LOG_DEBUG("Command '%s' failed with error code %d", c->name, retval);
+               char *full_name = command_name(c, ' ');
+               LOG_DEBUG("Command '%s' failed with error code %d",
+                                       full_name ? full_name : c->name, retval);
+               free(full_name);
        }
 
        return retval;