aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2020-07-13 11:57:27 -0400
committerDave Barach <openvpp@barachs.net>2020-12-10 12:59:27 +0000
commitb71653e9a82d21169a7b3ee770dd2c2e86eba80e (patch)
treefd556593881881af1071c59852a5d0f836775844 /src/vnet
parent1f3112e71644e69ad8a8498e56eab766b0fd5088 (diff)
misc: add a couple useful functions for gdb
- vgb() (vlib_get_buffer) - ph() (pool_header) Type: feature Signed-off-by: Christian Hopps <chopps@labn.net> Change-Id: Ica954480a7809c918cf65b06a0333ebe246a6f3a
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/unix/gdb_funcs.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/vnet/unix/gdb_funcs.c b/src/vnet/unix/gdb_funcs.c
index 29011f05ce1..3f2d54dc4d9 100644
--- a/src/vnet/unix/gdb_funcs.c
+++ b/src/vnet/unix/gdb_funcs.c
@@ -67,6 +67,20 @@ pe (void *v)
}
/**
+ * @brief GDB callable function: ph - call pool_header - get pool header.
+ *
+ * @param *p - void - address of pool
+ *
+ * @return pool_header_t
+ *
+ */
+pool_header_t *
+ph (void *p)
+{
+ return pool_header (p);
+}
+
+/**
* @brief GDB callable function: pifi - call pool_is_free_index - is passed index free?
*
* @param *p - void - address of pool
@@ -288,7 +302,10 @@ show_gdb_command_fn (vlib_main_t * vm,
vlib_cli_output (vm, "vb(b) returns vnet_buffer(b) [opaque]");
vlib_cli_output (vm, "vb2(b) returns vnet_buffer2(b) [opaque2]");
vlib_cli_output (vm, "vbi(b) returns b index");
+ vlib_cli_output (vm,
+ "vgb(bi) returns vlib_get_buffer(vlib_get_main(), bi)");
vlib_cli_output (vm, "pe(p) returns pool_elts(p)");
+ vlib_cli_output (vm, "ph(p) returns pool_header(p)");
vlib_cli_output (vm, "pifi(p, i) returns pool_is_free_index(p, i)");
vlib_cli_output (vm, "gdb_show_errors(0|1) dumps error counters");
vlib_cli_output (vm, "gdb_show_session dumps session counters");
@@ -309,6 +326,12 @@ VLIB_CLI_COMMAND (show_gdb_funcs_command, static) = {
};
/* *INDENT-ON* */
+vlib_buffer_t *
+vgb (u32 bi)
+{
+ return vlib_get_buffer (vlib_get_main (), bi);
+}
+
vnet_buffer_opaque_t *
vb (void *vb_arg)
{