简体   繁体   中英

GDB : compute double with print

I would like to make some computation with gdb when my program is at a breakpoint.

But here is my problem :

(gdb) call 2,6*2
$26 = 12

It doesn't compute at all double.

How can I say gdb to compute doubles ?

Thank you.

(gdb) call 2,6*2
$26 = 12
It doesn't compute at all double.

It's not supposed to: you gave the GDB call command a comma-expression, which it correctly evaluated.

You probably want:

(gdb) print 2.6 * 2
$1 = 5.1999999999999993

or

(gdb) call 2.6 * 2
$2 = 5.1999999999999993

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM