gdb/guile: Have gdbscm_safe_source_script return a unique_ptr
Change gdbscm_safe_source_script to return a gdb::unique_xmalloc_ptr<char> instead of a raw char*. Update the users of this function. There should be no user visible change after this commit. gdb/ChangeLog: * guile/guile-internal.h (gdbscm_safe_source_script): Change function return type. * guile/guile.c (gdbscm_source_script): Update to handle change in gdbscm_safe_source_script. * guile/scm-objfile.c (gdbscm_source_objfile_script): Likewise. * guile/scm-safe-call.c (gdbscm_safe_source_script): Change return type.
This commit is contained in:
parent
4896932e62
commit
9589edb836
5 changed files with 18 additions and 15 deletions
|
@ -270,13 +270,10 @@ static void
|
|||
gdbscm_source_script (const struct extension_language_defn *extlang,
|
||||
FILE *file, const char *filename)
|
||||
{
|
||||
char *msg = gdbscm_safe_source_script (filename);
|
||||
gdb::unique_xmalloc_ptr<char> msg = gdbscm_safe_source_script (filename);
|
||||
|
||||
if (msg != NULL)
|
||||
{
|
||||
fprintf_filtered (gdb_stderr, "%s\n", msg);
|
||||
xfree (msg);
|
||||
}
|
||||
fprintf_filtered (gdb_stderr, "%s\n", msg.get ());
|
||||
}
|
||||
|
||||
/* (execute string [#:from-tty boolean] [#:to-string boolean])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue