Search code examples
gdbada

How can i write an unambiguous expression of overloaded functions with different return types?


I'm trying to set a breakpoint with a condition. Lets say the condition is

condition 1 temp() > 0.0

but there are functions

int temp()

and

float temp()

in the same package. gdb then asks which function is intended (multiple matches). not just once, when the condition is defined, but every time the condition is evaluated. Is it possible to define the function unambiguously, for instance by specifying file and line?

I tried adding the return type the way it was specified in the alternative gdb produced, similar to "temp return int" but that led to an error.


Solution

  • Problem solved thanks to Mark Plotnicks comment: use the mangled name. In gdb, you can get the mangled name(s) of a function at line 123 in file.adb by running the command:

    info line file.adb:123
    

    Linux command objdump can also be used to find the mangled name, e.g.:

    objdump -t file.o