百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dbg-macro

> 编程语言
开源

C 的 dbg (.) 宏集

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

C 的 dbg (.) 宏集

|buildstatus|_ |codecov|_ |nala|_

About

A few macros that prints and returns the value of a given expression for quick and dirty debugging, inspired by Rusts dbg!(…) macro_ and its C++ variant_.

dbg(expr) for primitive data types (int, float, etc.), strings and pointers.

dbgb(expr) to force boolean true/false output.

dbga(expr, length) for array of primitive data types.

dbgh(expr, size) for hexdump output.

dbge(expr) for negative error codes.

dbgbt() for a backtrace.

Just include dbg.h_ in your project to use it.

Example

|tryit|_

See examples_ for the files used in this example.

.. code-block:: c

#include "dbg.h"

static int factorial(int n) { if (dbgb(n `` for custom output stream (stderr by default).

.. |buildstatus| image:: https://travis-ci.org/eerimoq/dbg-macro.svg?branch=master .. _buildstatus: https://travis-ci.org/eerimoq/dbg-macro

.. |codecov| image:: https://codecov.io/gh/eerimoq/dbg-macro/branch/master/graph/badge.svg .. _codecov: https://codecov.io/gh/eerimoq/dbg-macro

.. |tryit| image:: https://img.shields.io/badge/try-online-f34b7d.svg .. _tryit: https://repl.it/@eerimoq/dbg-macro

.. |nala| image:: https://img.shields.io/badge/nala-test-blue.svg .. _nala: https://github.com/eerimoq/nala

.. _dbg!(…) macro: https://doc.rust-lang.org/std/macro.dbg.html

.. _C++ variant: https://github.com/sharkdp/dbg-macro

.. _dbg.h: https://github.com/eerimoq/dbg-macro/blob/master/include/dbg.h

.. _examples: https://github.com/eerimoq/dbg-macro/tree/master/examples

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ccdbgdebugmacro

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言