diff options
author | Tristan Gingold | 2014-12-27 14:43:07 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-12-27 14:43:07 +0100 |
commit | 65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3 (patch) | |
tree | 2f404c0206c99c16693e6a998504f0c63d3029ad /src/ortho | |
parent | d563d20806b6ad4ae070858194f82d379a8a8a35 (diff) | |
download | ghdl-65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3.tar.gz ghdl-65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3.tar.bz2 ghdl-65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3.zip |
ortho-lang.c: use absolute path for debugging.
Diffstat (limited to 'src/ortho')
-rw-r--r-- | src/ortho/gcc/ortho-lang.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ortho/gcc/ortho-lang.c b/src/ortho/gcc/ortho-lang.c index 7e33c8c..020c9e5 100644 --- a/src/ortho/gcc/ortho-lang.c +++ b/src/ortho/gcc/ortho-lang.c @@ -474,13 +474,23 @@ static void ortho_parse_file (void) { const char *filename; + const char *dbg_filename; if (num_in_fnames == 0) filename = NULL; else filename = in_fnames[0]; - linemap_add (line_table, LC_ENTER, 0, filename ? filename :"*no-file*", 1); + /* Use absolute filenames for debug info. Works better than relative + filenames with some debuggers/tools. */ + if (filename == NULL) + dbg_filename = "*stdin*"; + else if (IS_ABSOLUTE_PATH (filename)) + dbg_filename = filename; + else + dbg_filename = concat (getpwd (), "/", filename, NULL); + + linemap_add (line_table, LC_ENTER, 0, dbg_filename, 1); input_location = linemap_line_start (line_table, 1, 252); if (!lang_parse_file (filename)) |