diff options
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r-- | gdb/infcall.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c index 5dd908d..f79afea 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -1104,8 +1104,11 @@ When the function is done executing, GDB will silently stop."), if (stopped_by_random_signal || stop_stack_dummy != STOP_STACK_DUMMY) { - const char *name = get_function_name (funaddr, - name_buf, sizeof (name_buf)); + /* Make a copy as NAME may be in an objfile freed by dummy_frame_pop. */ + char *name = xstrdup (get_function_name (funaddr, + name_buf, sizeof (name_buf))); + make_cleanup (xfree, name); + if (stopped_by_random_signal) { |