TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Debugging Firmware with GDB

98 点作者 fra大约 6 年前

5 条评论

AdmiralAsshat大约 6 年前
I used to work on a legacy piece of business software, written mostly in C. One recurring issue we noticed about GDB was that compiling a &quot;debug&quot; version of the binary to be able to GDB it often fixed whatever problem the program was having, such that we were no longer able to reproduce the issue. So it wasn&#x27;t uncommon for me to have this conversation with my manager:<p>Me: Customer is having their program X hit a SEGFAULT when they run it.<p>Manager: Did you transfer over a GDB version to backtrace the core dump?<p>Me: Yep.<p>Manager: What did it say?<p>Me: Well, when I run the same series of steps through the GDB version, it doesn&#x27;t segfault, so I have nothing to backtrace.<p>Manager: Huh...<p>Me: What would you like me to do?<p>Manager: Move the production binary aside, drop in the GDB version. Leave it there.
评论 #19976394 未加载
评论 #19975323 未加载
评论 #19975589 未加载
评论 #19975037 未加载
评论 #19979085 未加载
评论 #19977715 未加载
评论 #19975044 未加载
评论 #19986579 未加载
equalunique大约 6 年前
<p><pre><code> In this post, we’ll walk through setting up GDB for the following environment: A Nordic nRF52840 development kit </code></pre> Hoping this guide will be a useful reference for diving into the QMK[0] port to nRF52840 by Sekigon[1]. Scratch-built keyboards are my hobby and it would be nice to have something beefier than an atmega32u4 handling both the keymap&#x2F;layout and bluetooth.<p>[0] <a href="https:&#x2F;&#x2F;docs.qmk.fm&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.qmk.fm&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;sekigon-gonnoc&#x2F;qmk_firmware" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sekigon-gonnoc&#x2F;qmk_firmware</a>
评论 #19975126 未加载
tyhoff大约 6 年前
What I want, and what I think GDB really needs for people to use its Python API&#x27;s more frequently, is a way to easily manage, share, install, and collaborate with other people&#x27;s .gdbinit and GDB Python scripts.<p>I&#x27;ve written a number of these at my previous companies, which all get loaded by default when any developer was debugging (basically wrapping gdb in a &#x27;make gdb&#x27; style call). That works for internal development at a company where everyone is using the same flow, but that&#x27;s nearly impossible in the real world as every one has a different setup.<p>I&#x27;m assuming numerous companies have written a Linked List GDB Printer (such as <a href="https:&#x2F;&#x2F;github.com&#x2F;chrisc11&#x2F;debug-tips&#x2F;blob&#x2F;master&#x2F;gdb&#x2F;python-linked-list.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;chrisc11&#x2F;debug-tips&#x2F;blob&#x2F;master&#x2F;gdb&#x2F;pytho...</a>) or a script that prints useful information from the global variables particular to the RTOS running. These are all great, but they are a pain to install.<p>Is there really no better way to share these across the Internet other than &quot;Copy &#x2F; Paste this text into your .gdbinit&quot;? I&#x27;m thinking it would be possible and relatively painless to share these scripts through PyPi, require them, and load them like a normal package, but I haven&#x27;t seen this approach taken.
scoutt大约 6 年前
With modern JTAG probes and available software (like GDB or OpenOCD) it&#x27;s unthinkable going back to debugging with SW emulators, in-circuit emulators or with bare LEDs or a serial port (sometimes you have none).<p>Being able to debug firmware is very important to me, up to the point that the fact a chip (or family) is supported by OpenOCD becomes a determining factor when choosing a component for a new project. Specially if the project is (or could be) open sourced.<p>I don&#x27;t like proprietary debuggers. If a chip requires or forces me or my company to purchase Segger XYZ probe or a custom IDE, then it&#x27;s not discarded right away, but back to the bottom of the pile.<p>When there is no alternative, I find myself writing OpenOCD flash drivers even before starting any FW development.
Circuits大约 6 年前
who needs GDB when you have the good old fashion print statement... O.o
评论 #19975470 未加载
评论 #19978133 未加载
评论 #19975512 未加载