在GDB中打印局部变量

时间:2018-08-30 07:06:06

标签: c++ debugging gdb

如何在每个“下一个”或“步骤”命令中在GDB中打印局部变量?

有没有一种方法可以代替每次写“ info locals”?

1 个答案:

答案 0 :(得分:4)

如果可以使用GDB TUI mode,那可能是最好的。参见this answer

如果由于某种原因不能使用TUI,这也应该起作用:

var Marker = L.CircleMarker.extend({
     _updatePath: function() {
         if (this.options.shape === "square")
             this._renderer._updateMarkerSquare(this);
         if (this.options.shape === "diamond")
             this._renderer._updateMarkerDiamond(this);
     }
 });

    function style(feature) {
        return {
            radius: getRadius(feature.properties.size),
            shape: feature.properties.shape,
            fillColor: getColor(feature.properties.year),
            color: "#000",
            weight: 0,
            opacity: 1,
            fillOpacity: 0.9,
            renderer: myRenderer
        };
    }

有关挂钩命令here的更多信息。

相关问题