aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/gcc
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-12-27 14:43:07 +0100
committerTristan Gingold <tgingold@free.fr>2014-12-27 14:43:07 +0100
commit65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3 (patch)
tree2f404c0206c99c16693e6a998504f0c63d3029ad /src/ortho/gcc
parentd563d20806b6ad4ae070858194f82d379a8a8a35 (diff)
downloadghdl-65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3.tar.gz
ghdl-65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3.tar.bz2
ghdl-65f7e0c4279d2b901eab3ab5e5f9f9a96c6aa8d3.zip
ortho-lang.c: use absolute path for debugging.
Diffstat (limited to 'src/ortho/gcc')
-rw-r--r--src/ortho/gcc/ortho-lang.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ortho/gcc/ortho-lang.c b/src/ortho/gcc/ortho-lang.c
index 7e33c8c4b..020c9e5ea 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))