Home > Net >  Casting label type in gdb
Casting label type in gdb

Time:10-23

I am trying to learn assembly and I am using Ubuntu, I want to see the value of a label using GDB. Issue is that the label is one byte big and I cant cast it as just "p (byte)'label_name' ". And GDB does not seem to work if i dont tell it what the label size is.

CodePudding user response:

p (char)label_name works for me. GDB commands use C type names. (Showing it as a number and the ASCII character it represents for char. C doesn't have a separate type for 8-bit integer).

C doesn't have a type called byte, so (byte)foo is an error.

As Jester says, x /b &label_name might be what you want to eXamine memory, especially if you want to see multiple bytes starting from a certain point.

Within GDB, help x and help p will show details on how to use it.

Related:

  • Related