Skip to content

Instantly share code, notes, and snippets.

@troglobit
Last active April 22, 2022 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troglobit/a14322d93f08ba9972353e002a5a3cba to your computer and use it in GitHub Desktop.
Save troglobit/a14322d93f08ba9972353e002a5a3cba to your computer and use it in GitHub Desktop.
Developing and debugging libnl

Developing & debugging libnl

When I started out learning about libnl, around 10 years ago, I did not fully understand it. Mostly because I didn't (want to) understand Netlink. A great way to learn something is to try to fix a bug, or develop a new feature, because then you will want to write both tests and demo applications, which you may end up having to debug! Debuggers give you backtraces, which will help you understand how your program works.

Note: for debugging embedded systems using gdb-server, see the following blog post I wrote when I worked for Westermo: https://westermo.github.io/2022/02/18/debugging-embedded-systems/

Recently I got back into libnl again, relearning from scratch to port some local patches to a new version. So obviously I ran into problems almost immediately.

Working in the dark is something many developers are used to. Not just a dark room, but navigating code bases and systems without knowing how they actually work. In any other profession this would be considered madness, medeival even! So why do we stand for it?

Basically we're all just stressed out, all the time, with ignorant bosses and project managers running around asking why impossible tasks aren't already completed. So as a rule, we rarely invest in learning how things really work and just patch over problems, hoping it'll all work until the next time. It's terrible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment