aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-08-23 18:46:25 -0600
committerTom Tromey <tom@tromey.com>2024-10-19 13:18:00 -0600
commitf4ab1188c055d65c99663902317eb5ec4cfc7271 (patch)
tree33ebf54c8ac59e76f18028d2f6a9098c485d7d09 /gdb/source.h
parent03ace3807c891427019686f4137ad0257d63e138 (diff)
downloadbinutils-f4ab1188c055d65c99663902317eb5ec4cfc7271.zip
binutils-f4ab1188c055d65c99663902317eb5ec4cfc7271.tar.gz
binutils-f4ab1188c055d65c99663902317eb5ec4cfc7271.tar.bz2
Add cwd paramter to openp
This patch adds a cwd paramter to openp, so that the current directory can be passed in by the caller. This is useful when background threads call this function -- they can then avoid using the global and thus avoid races with the user using "cd". Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31716
Diffstat (limited to 'gdb/source.h')
-rw-r--r--gdb/source.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/source.h b/gdb/source.h
index 541ee3b..33ccda7 100644
--- a/gdb/source.h
+++ b/gdb/source.h
@@ -19,6 +19,7 @@
#ifndef SOURCE_H
#define SOURCE_H
+#include "gdbsupport/pathstuff.h"
#include "gdbsupport/scoped_fd.h"
struct program_space;
@@ -37,7 +38,8 @@ enum openp_flag
DEF_ENUM_FLAGS_TYPE(openp_flag, openp_flags);
extern int openp (const char *, openp_flags, const char *, int,
- gdb::unique_xmalloc_ptr<char> *);
+ gdb::unique_xmalloc_ptr<char> *,
+ const char *cwd = current_directory);
extern int source_full_path_of (const char *, gdb::unique_xmalloc_ptr<char> *);