gdb

run a program with commandline arguments

gdb --args <exe-name> <arg1> <arg2> <arg3>

one more methood

gdb <exe-name>
(gdb) set args <arg1> <arg2> <arg3>
(gdb) info local

list all defined function

(gdb) info functions

to print variable using variable name, you can use print command. the soht command for print is p

for example: print test p test

For example: to print a member of structure p data_base.name

By-default gdb prints a value according to its data type. if you want to print a variable value in diffrent formet then below are the list of output formet

x : print in hex. d : print in signed decimal. u : print in unsigned decimal. o : print in octal. t : print in binary c : print as a character constant. f : print in floating point

for example: p/x test


©2023-2024 rculock.com