{"id":25694,"date":"2019-05-12T16:23:44","date_gmt":"2019-05-12T20:23:44","guid":{"rendered":"https:\/\/www.dannyadam.com\/blog\/?p=25694"},"modified":"2023-07-20T11:00:49","modified_gmt":"2023-07-20T15:00:49","slug":"debugging-in-vim","status":"publish","type":"post","link":"https:\/\/www.dannyadam.com\/blog\/2019\/05\/debugging-in-vim\/","title":{"rendered":"Debugging in Vim"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/steps.gif\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/steps.gif\" class=\"wp-image\" alt=\"\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<p>Vim 8.1 was <a href=\"https:\/\/www.vim.org\/vim-8.1-released.php\">released<\/a> in May 2018. The &#8220;main new feature&#8221; was official support for running a terminal within <code>vim<\/code>. Along with this came a built-in debugger plugin, <code>termdebug<\/code>, which provides a visual interface for interacting with <code>gdb<\/code>. This post walks through an example session using <code>termdebug<\/code>.<\/p>\n\n\n<p><!--more--><\/p>\n\n\n<p> Let&#8217;s use <code>termdebug<\/code> to step through and inspect the following C program that calculates the factorial of a number. I&#8217;ll be using Ubuntu 18.04, along with a version of <code>vim<\/code> installed from the Ubuntu repo\u20148.0.1453\u2014that includes the relevant feature that was <a href=\"https:\/\/www.vim.org\/vim-8.1-released.php\">officially released<\/a> as part of <code>vim<\/code> 8.1.<\/p>\n\n\n<p><style>.gist table { margin-bottom: 0; }<\/style><div style=\"tab-size: 8\" id=\"gist96167080\" class=\"gist\">\n    <div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n      <div class=\"gist-data\">\n        \n<div class=\"js-gist-file-update-container js-task-list-container\">\n      <div id=\"file-factorial-c\" class=\"file my-2\">\n    \n    <div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-c  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"factorial.c content, created by dstein64 on 02:38PM on May 12, 2019.\"\n    >\n\n        \n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n\n  <template class=\"js-file-alert-template\">\n  <div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n    <span>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a>\n    <\/span>\n\n\n  <div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters\n<\/a>\n<\/div>\n<\/div><\/template>\n<template class=\"js-line-alert-template\">\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\">\n    <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg>\n<\/span><\/template>\n\n  <table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"factorial.c\">\n        <tr>\n          <td id=\"file-factorial-c-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n          <td id=\"file-factorial-c-LC1\" class=\"blob-code blob-code-inner js-file-line\">#include &lt;assert.h&gt;<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n          <td id=\"file-factorial-c-LC2\" class=\"blob-code blob-code-inner js-file-line\">#include &lt;stdio.h&gt;<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n          <td id=\"file-factorial-c-LC3\" class=\"blob-code blob-code-inner js-file-line\">#include &lt;stdlib.h&gt;<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n          <td id=\"file-factorial-c-LC4\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n          <td id=\"file-factorial-c-LC5\" class=\"blob-code blob-code-inner js-file-line\">\/*<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n          <td id=\"file-factorial-c-LC6\" class=\"blob-code blob-code-inner js-file-line\"> * Calculates factorial.<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n          <td id=\"file-factorial-c-LC7\" class=\"blob-code blob-code-inner js-file-line\"> * Overflow is not checked\/handled.<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n          <td id=\"file-factorial-c-LC8\" class=\"blob-code blob-code-inner js-file-line\"> *\/<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n          <td id=\"file-factorial-c-LC9\" class=\"blob-code blob-code-inner js-file-line\">int factorial(int x) {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n          <td id=\"file-factorial-c-LC10\" class=\"blob-code blob-code-inner js-file-line\">  assert(x &gt;= 0);<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n          <td id=\"file-factorial-c-LC11\" class=\"blob-code blob-code-inner js-file-line\">  int result = 1;<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n          <td id=\"file-factorial-c-LC12\" class=\"blob-code blob-code-inner js-file-line\">  for (int i = 1; i &lt;= x; ++i) {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n          <td id=\"file-factorial-c-LC13\" class=\"blob-code blob-code-inner js-file-line\">    result *= i;<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n          <td id=\"file-factorial-c-LC14\" class=\"blob-code blob-code-inner js-file-line\">  }<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n          <td id=\"file-factorial-c-LC15\" class=\"blob-code blob-code-inner js-file-line\">  return result;<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n          <td id=\"file-factorial-c-LC16\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n          <td id=\"file-factorial-c-LC17\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n          <td id=\"file-factorial-c-LC18\" class=\"blob-code blob-code-inner js-file-line\">int main(int argc, char* argv[]) {<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n          <td id=\"file-factorial-c-LC19\" class=\"blob-code blob-code-inner js-file-line\">  assert(argc == 2);<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n          <td id=\"file-factorial-c-LC20\" class=\"blob-code blob-code-inner js-file-line\">  int x = atoi(argv[1]);<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L21\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n          <td id=\"file-factorial-c-LC21\" class=\"blob-code blob-code-inner js-file-line\">  int result = factorial(x);<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L22\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"22\"><\/td>\n          <td id=\"file-factorial-c-LC22\" class=\"blob-code blob-code-inner js-file-line\">  printf(&quot;%d\\n&quot;, result);<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L23\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"23\"><\/td>\n          <td id=\"file-factorial-c-LC23\" class=\"blob-code blob-code-inner js-file-line\">  return EXIT_SUCCESS;<\/td>\n        <\/tr>\n        <tr>\n          <td id=\"file-factorial-c-L24\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"24\"><\/td>\n          <td id=\"file-factorial-c-LC24\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n        <\/tr>\n  <\/table>\n<\/div>\n\n\n    <\/div>\n\n  <\/div>\n\n<\/div>\n\n      <\/div>\n      <div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/dstein64\/97220e16b9e316cf4f8a0b50229408aa\/raw\/c67572ef6a03b15dad9bf78600a2f28024866e1b\/factorial.c\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a>\n        <a href=\"https:\/\/gist.github.com\/dstein64\/97220e16b9e316cf4f8a0b50229408aa#file-factorial-c\" class=\"Link--inTextBlock\">\n          factorial.c\n        <\/a>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n    <\/div>\n<\/div>\n<\/p>\n\n\n<p>In addition to <code>vim<\/code>, a working version of <code>gdb<\/code> is required for debugging. For Ubuntu, this can be installed from the Ubuntu repo. For macOS, <code>gdb<\/code> will have to be <em><a href=\"https:\/\/sourceware.org\/gdb\/wiki\/PermissionsDarwin\">code signed<\/a><\/em>, and I&#8217;ve found that <code>gdb<\/code> versions earlier than 8.3 are problematic (tested on macOS Mojave). I haven&#8217;t tested debugging on Windows. Before trying to debug with <code>vim<\/code>, I suggest verifying that <code>gdb<\/code> works as expected on your system.<\/p>\n\n\n\n<p>The path and\/or name of <code>gdb<\/code> can be modified by setting the <code>termdebugger<\/code> variable before invoking the <code>termdebug<\/code> plugin.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Loading the <code>termdebug<\/code> Plugin<\/strong><\/h3>\n\n\n\n<p>After loading the <code>factorial.c<\/code> source code, let&#8217;s load the plugin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:packadd termdebug\n:Termdebug<\/code><\/pre>\n\n\n\n<p>The tab will split into three windows, which I&#8217;ve rearranged so that the editor window is on the right, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/plugin_loaded.png\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/plugin_loaded.png\" class=\"wp-image\" alt=\"\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<p>The top-left window is for interacting with <code>gdb<\/code>. The bottom-left window is for interacting with the program loaded by <code>gdb<\/code>. The editor window on the right\u2014with the corresponding source code\u2014will show breakpoints and highlight lines when stepping through a program. This window also has clickable buttons at the top for interacting with <code>gdb<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Loading a Program<\/strong><\/h3>\n\n\n\n<p>We&#8217;ll have to compile the code using the <code>-g<\/code> flag, which will include debugger information in the compiled program.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:!gcc -g factorial.c -o factorial<\/code><\/pre>\n\n\n\n<p>We can use the <code>gdb<\/code> window to load the program. In addition to <code>&lt;c-w&gt;<\/code> commands and\/or mouse clicks, we can use the <code>:Gdb<\/code> command to jump to the <code>gdb<\/code> window. The following <code>gdb<\/code> command will load the program (highlighted in the image that follows).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(gdb) file factorial<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/file_loaded.png\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/file_loaded.png\" class=\"wp-image\" alt=\"\" class=\"wp-image\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<p>Alternatively, we could have passed <code>factorial<\/code> as an argument when calling <code>:Termdebug<\/code> earlier.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Setting Breakpoints<\/strong><\/h3>\n\n\n\n<p>Breakpoints can be set in the <code>gdb<\/code> window using ordinary <code>gdb<\/code> commands.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(gdb) b factorial\n(gdb) b 23<\/code><\/pre>\n\n\n\n<p>Alternatively, breakpoints can be set by navigating to a line of code in the editor window and entering <code>:Break<\/code>.<\/p>\n\n\n\n<p>Lines with breakpoints are indicated by <span style=\"background-color: red\"><strong><code>&gt;&gt;<\/code><\/strong><\/span> in the editor window.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/breakpoints.png\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/breakpoints.png\" class=\"wp-image\" alt=\"\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<p>Breakpoints can be removed with <code>gdb<\/code> commands <s>or by navigating to the relevant lines and entering <\/s><code><s>:Delete<\/s><\/code>. <strong>Update 2019\/05\/12 6:45pm ET<\/strong>: On my version of <code>vim<\/code>, <code>:Delete<\/code> is used to remove breakpoints, but this was changed to <code>:Clear<\/code> in a <a href=\"https:\/\/github.com\/vim\/vim\/commit\/71137fed4d77e985d49ca32c79f030512767b8ce\">commit<\/a> on March 3, 2018.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Program Execution<\/strong><\/h3>\n\n\n\n<p>The <code>:Run<\/code> command starts the program.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:Run &#91;args]<\/code><\/pre>\n\n\n\n<p>Or alternatively, a program can be launched by entering the <code>run<\/code> command directly in the <code>gdb<\/code> window.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(gdb) run &#91;args]<\/code><\/pre>\n\n\n\n<p>In either case, <code>[args]<\/code> should be replaced by the program&#8217;s arguments. Let&#8217;s use the value <code>6<\/code> to run the <code>factorial<\/code> program.<\/p>\n\n\n\n<p>Both <code>:Run<\/code> and <code>(gdb) run<\/code> will pause execution at the first breakpoint. An alternative way to launch a program is to use <code>gdb<\/code>\u2019s <code>start<\/code> command, which will pause execution at the beginning of the program.<\/p>\n\n\n\n<p>I&#8217;ve launched the program using the <code>vim<\/code> command <code>:Run 6<\/code>. Execution is paused at the first breakpoint, with the corresponding line highlighted.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/run.png\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/run.png\" class=\"wp-image\" alt=\"\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Stepping through Code<\/strong><\/h3>\n\n\n\n<p>There are various ways to step through a program.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Invoking <code>gdb<\/code> stepping commands directly in the <code>gdb<\/code> window<\/li><li>Clicking <em>Step<\/em>, <em>Next<\/em>, <em>Finish<\/em>, <em>Cont<\/em>, <em>Stop<\/em>, <em>Eval<\/em> in the editor window<\/li><li>Issuing <code>vim<\/code> commands <code>:Step<\/code>, <code>:Over<\/code>, <code>:Finish<\/code>, <code>:Continue<\/code>, <code>:Stop<\/code><\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/steps.gif\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/steps.gif\" class=\"wp-image\" alt=\"\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Program Inspection<\/strong><\/h3>\n\n\n\n<p>The values of variables can be inspected in various ways.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Invoking <code>gdb<\/code> inspection commands directly in the <code>gdb<\/code> window<\/li><li>Hovering your mouse over variables in the editor window<ol><li>This requires the <code>+balloon_eval<\/code> compile-time feature<\/li><li>This worked for me in <code>gvim<\/code>, but didn&#8217;t work reliably when running <code>vim<\/code> in a terminal<\/li><\/ol><\/li><li>Issuing <code>vim<\/code> command <code>:Evaluate {expr}<\/code><br>Omitting <code>{expr}<\/code> will evaluate the expression under the cursor, which can also be performed by pressing <code>K<\/code><\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/eval.gif\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/eval.gif\" class=\"wp-image\" alt=\"\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h3>\n\n\n\n<p>After passing all breakpoints and running the program until termination, we can see <code>720<\/code> in the program window, which is the expected output for the calculation of <code>6!<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/finished.png\"><img decoding=\"async\" src=\"https:\/\/www.dannyadam.com\/blog\/wp-content\/uploads\/2019\/05\/finished.png\" class=\"wp-image\" alt=\"\" style=\"max-width:100%;\" width=\"400\"><\/a><\/figure>\n\n\n\n<p>The built-in help page includes thorough documentation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:help terminal-debug<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Vim 8.1 was released in May 2018. The &#8220;main new feature&#8221; was official support for running a terminal within vim. Along with this came a built-in debugger plugin, termdebug, which provides a visual interface for interacting with gdb. This post walks through an example session using termdebug.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[64,63,59],"class_list":["post-25694","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-debugging","tag-gdb","tag-vim"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1sCC6-6Gq","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts\/25694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/comments?post=25694"}],"version-history":[{"count":111,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts\/25694\/revisions"}],"predecessor-version":[{"id":26936,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/posts\/25694\/revisions\/26936"}],"wp:attachment":[{"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/media?parent=25694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/categories?post=25694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dannyadam.com\/blog\/wp-json\/wp\/v2\/tags?post=25694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}