Re: [PATCH] infcall: Add support for integer literals as reference function paramters

Tom Tromey
2025-10-17T14:50:56Z

>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> This patch attempts to mitigate the shortcomings of passing literals
Keith> to inferior function calls requiring references. The specific use case here
Keith> is std::map's operator[]:

Keith> (gdb) print int_map[1]
Keith> Attempt to take address of value not located in memory.

I didn't see in the text or the patch what the method type really is.

Keith> +#include
Keith> +#include <string>

It's better for tests not to use libstdc++ stuff if possible, and to
just write out a method with the problem signature in a locally-defined
type.

Keith> -if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == -1} {
Keith> +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {

This results in starting an extra gdb that is immediately exited.

Tom