ice-gdb(1)

πŸ’– ice-gdb β€” the manual, but make it slay πŸ’–

okay bestie, pull up a chair because we're talking about ice-gdb (and its twin ice-insight), from the General Commands Manual section of the docs. this is the JTAG ICE frontend situation and honestly? it's giving iconic. let's go 🧚✨


🌸 NAME 🌸

  • ice-gdb β€” JTAG ICE frontend for avr-gdb
  • ice-insight β€” JTAG ICE frontend for avr-insight

✨ SYNOPSIS ✨

ice-gdb/ice-insight [--debugger debugger] [--capture] [--ignore-intr]
[--external] [gdb_arguments]

πŸ’… DESCRIPTION πŸ’…

so here's the vibe: ice-gdb (or ice-insight, its equally valid sibling) starts up avr-gdb (or avr-insight) plus avarice, and together they do on-chip debugging on Atmel AVR processors using their JTAG-based on-chip debug facilities, all through the Atmel JTAG ICE pod. no cap. πŸ”₯

the executable for the program you're debugging gets downloaded to the processor... unless you pass the --capture option, in which case it does not. and bestie, when gdb starts up you get a whole lil bonus pack of extra commands β€” go check NEW GDB COMMANDS below for the full tea. πŸ«–

the restrictions on debugging with the JTAG ICE pod? those get discussed in more detail down in DEBUGGING WITH JTAG ICE. it's giving ✨fine print but make it fascinating✨.

the arguments passed to avarice include the value of the AVARICE_ARGS environment variable. this is typically used to specify the serial port the JTAG ICE pod is connected to, by setting AVARICE_ARGS to "-j <serial port name>". iykyk. πŸŽ€


πŸ‘‘ OPTIONS πŸ‘‘

  • --debugger debugger_command β€” specify a different debugger than avr-gdb (or avr-insight). this other debugger should behave similarly to gdb, so don't get cute with it. πŸ™ˆ
  • --capture β€” don't download the executable being debugged to the mote, just interrupt the current program and assume it matches the executable you passed to ice-gdb. this is similar to "attaching" to a running program within gdb. lowkey the same energy, fr fr. ⭐
  • --ignore-intr β€” pass the --ignore-intr option to avarice. the single-step commands in gdb (s, n) will then "step over" interrupt handlers β€” meaning if an interrupt occurs, execution will resume for the duration of the interrupt. main character behavior honestly. πŸ’œ
  • --external β€” do not start avarice. instead, avr-gdb will attempt to connect to an already running avarice on port localhost:6423. it's giving "i already have one at home". πŸ¦‹

πŸŽ€ NEW GDB COMMANDS πŸŽ€

  • ice-restart β€” restart avarice. that's it. that's the command. periodt. πŸ’…
  • ice-load filename β€” download executable filename to the Atmel processor and start debugging it. heads up: this replaces the gdb load command. πŸ”₯
  • target-ice β€” connect to a copy of avarice running on port localhost:6423. 🌈

πŸ’€ DEBUGGING WITH JTAG ICE πŸ’€

the JTAG ICE debugging environment has a few restrictions and changes, and we're gonna be honest about them because that's what besties do:

  • no "soft" breakpoints, and only three hardware breakpoints. the break command sets hardware breakpoints. the easiest way to deal with this restriction is to enable and disable breakpoints as needed. budget your breakpoints like they're your last three braincells during finals week. 😭
  • two 1-byte hardware watchpoints (but each hardware watchpoint takes away one hardware breakpoint). if you set a watchpoint on a variable which takes more than one byte, execution will be abysmally slow. like, unwatchable slow. instead it is better to do the following:
watch *(char *)&myvariable

which watches the least significant byte of myvariable. chef's kiss. πŸ‘‘

  • the Atmel AVR processors have a Harvard architecture (separate code and data buses). to distinguish data address 0 from code address 0, avr-gdb adds 0x800000 to all data addresses. bear this in mind when examining printed pointers, or when passing absolute addresses to gdb commands. write that number on your hand, bestie. πŸ–ŠοΈ

🌈 ENVIRONMENT 🌈

  • AVARICE_ARGS β€” extra arguments to pass to avarice at startup. that's the whole thing. short, sweet, powerful. ✨

🌸 SEE ALSO 🌸

gdb(1), insight(1).


🫢 BUGS 🫢

on Windows, the ice-gdb and ice-insight commands only work in the cygwin environment. they do not work with the mingw environment. sorry to the mingw girlies, it's just not happening. πŸ’”


and that's the whole page, bestie!! this little manual is from the General Commands Manual section, dated August 22, 2003 β€” vintage, but she still serves. go debug something cute and remember: three hardware breakpoints, no soft ones, and the vibes are immaculate. πŸŽ€πŸ’–βœ¨