Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
card10
openocd
Commits
8a416563
Commit
8a416563
authored
Nov 23, 2009
by
Zachary T Welch
Browse files
trace: use register_commands()
parent
5f6962b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/target/trace.c
View file @
8a416563
...
...
@@ -156,16 +156,35 @@ COMMAND_HANDLER(handle_trace_history_command)
return
ERROR_OK
;
}
static
const
struct
command_registration
trace_exec_command_handlers
[]
=
{
{
.
name
=
"history"
,
.
handler
=
&
handle_trace_history_command
,
.
mode
=
COMMAND_EXEC
,
.
help
=
"display trace history, clear history or set [size]"
,
.
usage
=
"[clear|<size>]"
,
},
{
.
name
=
"point"
,
.
handler
=
&
handle_trace_point_command
,
.
mode
=
COMMAND_EXEC
,
.
help
=
"display trace points, clear list of trace points, "
"or add new tracepoint at [address]"
,
.
usage
=
"[clear|<address>]"
,
},
COMMAND_REGISTRATION_DONE
};
static
const
struct
command_registration
trace_command_handlers
[]
=
{
{
.
name
=
"trace"
,
.
mode
=
COMMAND_ANY
,
.
help
=
"trace command group"
,
.
chain
=
trace_exec_command_handlers
,
},
COMMAND_REGISTRATION_DONE
};
int
trace_register_commands
(
struct
command_context
*
cmd_ctx
)
{
struct
command
*
trace_cmd
=
COMMAND_REGISTER
(
cmd_ctx
,
NULL
,
"trace"
,
NULL
,
COMMAND_ANY
,
"trace commands"
);
COMMAND_REGISTER
(
cmd_ctx
,
trace_cmd
,
"history"
,
handle_trace_history_command
,
COMMAND_EXEC
,
"display trace history, ['clear'] history or set [size]"
);
COMMAND_REGISTER
(
cmd_ctx
,
trace_cmd
,
"point"
,
handle_trace_point_command
,
COMMAND_EXEC
,
"display trace points, ['clear'] list of trace points, or add new tracepoint at [address]"
);
return
ERROR_OK
;
return
register_commands
(
cmd_ctx
,
NULL
,
trace_command_handlers
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment