Dbx 1024 User's Guide Page 67

  • Download
  • Add to my manuals
  • Print
  • Page
    / 158
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 66
Using Interactive Function Calls
53
To perform a complete dump of the program’s active variables, enter:
(dbx) dump .
> 0 foo2(i = 5) [“/usr/var/tmp/dbx_examples/foo.c”:46, 0x10001214]
1 foo(i = 4) [“/usr/var/tmp/dbx_examples/foo.c”:40, 0x100011d4]
r = 0
2 main(argc = 1, argv = 0xffffffad78) [“/usr/var/tmp/dbx_examples/
test4.c”:25, 0x10000fa0]
j = 4
i = 12
r = <bad operand>
a = 0
total = 0
Using Interactive Function Calls
You can interactively call a function in your program from dbx.
If the function returns a value, you can use that function in a normal dbx
expression. For example, consider a functionprime defined in your program
that accepts an integer value as an argument, and returns 1 if the value is
prime and 0 if it is not. You can call this function interactively and print the
results by entering a command such as:
(dbx) print prime(7)
1
Using ccall
If your function does not return a value, or if you want to execute a function
primarily for its side effects, you can execute the function interactively with
the dbx command ccall:
ccall func(arg1, arg2, ... , argn)
This command calls a function with the given arguments.
Regardless of the language the function was written in, the
call is interpreted as if it were written in C, and normal C
calling conventions are used.
Note: Structure and union arguments to a function, and structure and union
returns from a function, are not supported.
Page view 66
1 2 ... 62 63 64 65 66 67 68 69 70 71 72 ... 157 158

Comments to this Manuals

No comments