mirror of
https://github.com/crash-utility/crash
synced 2025-04-01 23:00:52 +00:00
Display a fatal error message if the "tree -l" option is attempted
with radix trees. Without the patch, the option would be silently ignored. (neelx@redhat.com)
This commit is contained in:
parent
90642e6ffa
commit
9aa345148c
11
help.c
11
help.c
@ -5658,7 +5658,7 @@ NULL
|
||||
char *help_tree[] = {
|
||||
"tree",
|
||||
"display radix tree or red-black tree",
|
||||
"-t [radix|rbtree] [-r offset] [-[s|S] struct[.member[,member]] -[x|d]]\n [-o offset] [-p] [-l] [-N] start",
|
||||
"[-t [radix|rbtree]] [-r offset] [-[s|S] struct[.member[,member]]] -[x|d]\n [-o offset] [-l] [-p] [-N] start",
|
||||
" This command dumps the contents of a radix tree or a red-black tree.",
|
||||
" The arguments are as follows:\n",
|
||||
" -t type The type of tree to dump; the type string can be either ",
|
||||
@ -5691,15 +5691,16 @@ char *help_tree[] = {
|
||||
" -S struct Similar to -s, but instead of parsing gdb output, member values",
|
||||
" are read directly from memory, so the command works much faster",
|
||||
" for 1-, 2-, 4-, and 8-byte members.",
|
||||
" -x Override default output format with hexadecimal format.",
|
||||
" -d Override default output format with decimal format.",
|
||||
" -l For red-black trees, dump the tree sorted in linear order starting",
|
||||
" with the leftmost node and progressing to the right. This option",
|
||||
" does not apply to radix trees.",
|
||||
" -p Display the node's position information, showing the relationship",
|
||||
" between it and the root. For red-black trees, a position that",
|
||||
" indicates \"root/l/r\" means that the node is the right child",
|
||||
" of the left child of the root node. For radix trees, the height",
|
||||
" and slot index values are shown with respect to the root.",
|
||||
" -l Dump the tree sorted in linear order starting with the leftmost",
|
||||
" node and progressing to the right.",
|
||||
" -x Override default output format with hexadecimal format.",
|
||||
" -d Override default output format with decimal format.",
|
||||
" ",
|
||||
" The meaning of the \"start\" argument, which can be expressed either in",
|
||||
" hexadecimal format or symbolically, depends upon whether the -N option",
|
||||
|
13
tools.c
13
tools.c
@ -3946,6 +3946,10 @@ cmd_tree()
|
||||
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
td->flags |= TREE_LINEAR_ORDER;
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
if (td->flags & TREE_ROOT_OFFSET_ENTERED)
|
||||
error(FATAL,
|
||||
@ -3993,10 +3997,6 @@ cmd_tree()
|
||||
td->flags |= TREE_POSITION_DISPLAY;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
td->flags |= TREE_LINEAR_ORDER;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
td->flags |= TREE_NODE_POINTER;
|
||||
break;
|
||||
@ -4023,12 +4023,15 @@ cmd_tree()
|
||||
if (argerrs)
|
||||
cmd_usage(pc->curcmd, SYNOPSIS);
|
||||
|
||||
if ((type_flag & RADIXTREE_REQUEST) && (td->flags & TREE_LINEAR_ORDER))
|
||||
error(FATAL, "-l option is not applicable to radix trees\n");
|
||||
|
||||
if ((type_flag & RADIXTREE_REQUEST) && (td->flags & TREE_NODE_OFFSET_ENTERED))
|
||||
error(FATAL, "-o option is not applicable to radix trees\n");
|
||||
|
||||
if ((td->flags & TREE_ROOT_OFFSET_ENTERED) &&
|
||||
(td->flags & TREE_NODE_POINTER))
|
||||
error(INFO, "-r and -N options are mutually exclusive\n");
|
||||
error(FATAL, "-r and -N options are mutually exclusive\n");
|
||||
|
||||
if (!args[optind]) {
|
||||
error(INFO, "a starting address is required\n");
|
||||
|
Loading…
Reference in New Issue
Block a user