News for hackers. Stuff that matters.
Re:How Does a C Debugger Work? (2014) by PaulDavisThe1st on Sunday October 18, 2020 @02:45AM (#24815966)
gdb) watch my_ptr

what does this mean? watch when the value at the address given by my_ptr changes, or watch when the value of my_ptr changes (i.e. it is modified to point to a different location) ?

gdb) watch * my_ptr

Ah ... now it's clear what is meant.

gdb) watch 0xfeedface

hmm, now 0xfeedface is not a variable but literally an address. But wait, is it? What does this mean? Watch the value at memory location 0xfeedface? But that's totally inconsistent with the semantics of "watch my_ptr". So,

gdb) watch * 0xfeedface

and once again, no ambiguity over what is going on and consistent syntax.

As for you other complaints, I've been programming for about 33 years in C and C++, and I don't recall ever needing to use a hexdump inside the debugger or the disassemble command. Which is not to say that they're not important for some work, but they are also not important for all work.

Re:How Does a C Debugger Work? (2014) by mormegil on Sunday October 18, 2020 @03:24AM (#24816106)
Wasn't that _exactly_ the OP's point? That GDB is a fine C debugger but its logic and UX choices do not make much sense for debugging assembly code (e.g. there are no asterisks in assembly addresses, so no consistency there, etc.).
Re:How Does a C Debugger Work? (2014) by tom_ on Sunday October 18, 2020 @10:49AM (#24818220)
Names of locations in assembly language are typically constants, similar to global arrays in C. There's no my_ptr, as such; there's an address, and my_ptr is its name. When you watch my_ptr, you want to monitor what's at that address - ``watch *my_ptr'', in gdb terms.

Not the end of the world, just annoying.

Re:How Does a C Debugger Work? (2014) by PaulDavisThe1st on Sunday October 18, 2020 @11:59AM (#24818793)
It seems that people read my comment as sarcastic. It wasn't. I was trying to make the point you're making.
Re:How Does a C Debugger Work? (2014) by mhh__ on Sunday October 18, 2020 @03:20AM (#24816094)
I think GDB is an example of a program which should've been designed around a kind of inverse Greenspun's tenth rule principle i.e. vague semantics and weird syntax so just build a lisp from the start to control it.
Re:How Does a C Debugger Work? (2014) by secondcoming on Sunday October 18, 2020 @10:36AM (#24818142)
> Ah ... now it's clear what is meant.

Is it? I can't tell if your post has a sarcastic tone or not!

Re:How Does a C Debugger Work? (2014) by PaulDavisThe1st on Sunday October 18, 2020 @11:59AM (#24818797)
not sarcastic.