aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/compile/compile.c')
-rw-r--r--gdb/compile/compile.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 88531a2..89f9790 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -17,6 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include "progspace.h"
#include "ui.h"
#include "ui-out.h"
#include "command.h"
@@ -302,14 +303,13 @@ compile_file_command (const char *args, int from_tty)
enum compile_i_scope_types scope
= options.raw ? COMPILE_I_RAW_SCOPE : COMPILE_I_SIMPLE_SCOPE;
- args = skip_spaces (args);
+ std::string filename = extract_single_filename_arg (args);
/* After processing options, check whether we have a filename. */
- if (args == nullptr || args[0] == '\0')
+ if (filename.empty ())
error (_("You must provide a filename for this command."));
- args = skip_spaces (args);
- std::string abspath = gdb_abspath (args);
+ std::string abspath = gdb_abspath (filename.c_str ());
std::string buffer = string_printf ("#include \"%s\"\n", abspath.c_str ());
eval_compile_command (NULL, buffer.c_str (), scope, NULL);
}
@@ -327,8 +327,8 @@ compile_file_command_completer (struct cmd_list_element *ignore,
(tracker, &text, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_ERROR, group))
return;
- word = advance_to_filename_complete_word_point (tracker, text);
- filename_completer (ignore, tracker, text, word);
+ word = advance_to_filename_maybe_quoted_complete_word_point (tracker, text);
+ filename_maybe_quoted_completer (ignore, tracker, text, word);
}
/* Handle the input from the 'compile code' command. The
@@ -487,7 +487,8 @@ get_expr_block_and_pc (CORE_ADDR *pc)
if (block == NULL)
{
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+ symtab_and_line cursal
+ = get_current_source_symtab_and_line (current_program_space);
if (cursal.symtab)
block = cursal.symtab->compunit ()->blockvector ()->static_block ();