Skip to content

Instantly share code, notes, and snippets.

@jclosure
jclosure / gdb_inspecting_stl_containers.md
Created October 2, 2017 19:06
Debugging STL objects in GDB

Original: https://github.com/NREL/EnergyPlus/wiki/Debugging-STL-objects-in-GDB

Overview

This documents how to add STL visualizer support in gdb. This information was pulled together from a variety of sources on the web to ultimately get it working well. Without these pretty printers, you get some details (that might be interesting sometimes) like:

(gdb) print foo_int_vector
$1 = {<std::_Vector_base<int, std::allocator<int> >> = {_M_impl = {<std::allocator<int>> = {<__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>}, _M_start = 0x603010, _M_finish = 0x60301c, 
      _M_end_of_storage = 0x60301c}}, <No data fields>}
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP