public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Jepsen Hans Peter <hans_peter_jepsen@Danfoss.com>
To: 'Steve deRosier' <sderosier@vari-lite.com>,
	crossgcc <crossgcc@sources.redhat.com>
Subject: RE: crossgcc debug with HP emulator
Date: Sun, 01 Apr 2001 00:00:00 -0000	[thread overview]
Message-ID: <829F632D2F25D411B6920008C716F83114C6EC@dd01-e01.drives.danfoss.dk> (raw)
Message-ID: <20010401000000.vq0hmgyNkxbHUldwLgOU5hR5LU7qrnfOrEs9LFPW5PY@z> (raw)

[-- Attachment #1: Type: text/plain, Size: 2697 bytes --]

Hi 

Steve deRosier wrote:

> I am having problems creating code with my crossgcc that 
> works properly with the HP emulator that we are using.  
...

> Is there a flag that I am missing or another
> permutation of the -g flag that will allow me to display the 
> C/C++ source in my debugger? 

We had the same problem. I ended up in modifying gcc as shown in the
attached small patch.

The effect is to add an option: -fkeep-file-path
that, when applied, does not strip the path from the supplied filename.

For us it works with HP emulator and Lauterbach hostdriver.

Kind regards

Hans Peter

   --
Hans Peter Jepsen          Phone: +45 74 88 50 11
Danfoss Drives A/S,        Fax:   +45 74 65 28 38
DG-133, Ulsnaes 1,         Email: Hans_Peter_Jepsen@danfoss.com
DK-6300 Graasten, Denmark  or:    hpj@computer.org



*** egcs-1.1b/gcc/toplev.c.orig	Sun May  2 20:47:14 1999
--- egcs-1.1b/gcc/toplev.c	Mon Jun 21 09:06:40 1999
***************
*** 721,726 ****
--- 721,731 ----
     if alias analysis (in general) is enabled.  */
  int flag_strict_aliasing = 0;
  
+ /* -fkeep-file-path causes the file directive in the outputfile to be the
name
+    given on the commandline, ie a possible directory path is not removed.
+    Normal/default behavior is to strip the path */
+ int keep_file_path = 0;
+ 
  extern int flag_dump_unnumbered;
  
  
***************
*** 908,913 ****
--- 913,920 ----
     "Generate code to check every memory access" },
    {"prefix-function-name", &flag_prefix_function_name, 1,
     "Add a prefix to all function names" },
+   {"keep-file-path", &keep_file_path,1,
+    "Do not strip path in .file directive"},
    {"dump-unnumbered", &flag_dump_unnumbered, 1}
  };
  
***************
*** 2371,2386 ****
       FILE *asm_file;
       char *input_name;
  {
!   int len = strlen (input_name);
!   char *na = input_name + len;
  
!   /* NA gets INPUT_NAME sans directory names.  */
!   while (na > input_name)
!     {
!       if (na[-1] == '/')
! 	break;
!       na--;
!     }
  
  #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
    ASM_OUTPUT_MAIN_SOURCE_FILENAME (asm_file, na);
--- 2378,2400 ----
       FILE *asm_file;
       char *input_name;
  {
!    char *na;
!    
!    if ( keep_file_path) /* leave the input_name unchanged */
!       na = input_name;
!    else /* strip leadin path from input_name - default behaviour */
!    {      
!       int len = strlen (input_name);
!       na = input_name + len;
  
!       /* NA gets INPUT_NAME sans directory names.  */
!       while (na > input_name)
!       {
! 	 if (na[-1] == '/')
! 	    break;
! 	 na--;
!       }
!    }
  
  #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
    ASM_OUTPUT_MAIN_SOURCE_FILENAME (asm_file, na);


[-- Attachment #2: toplev.c.patch.gz --]
[-- Type: application/x-gzip, Size: 813 bytes --]

             reply	other threads:[~2001-04-01  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-09  5:54 Jepsen Hans Peter [this message]
2001-04-01  0:00 ` Jepsen Hans Peter
  -- strict thread matches above, loose matches on Subject: below --
2001-01-09 23:23 Jepsen Hans Peter
2001-04-01  0:00 ` Jepsen Hans Peter
2001-01-09  7:50 Steve deRosier
2001-04-01  0:00 ` Steve deRosier
2001-01-06  4:47 John Breen
2001-04-01  0:00 ` John Breen
2001-01-05  9:38 Steve deRosier
2001-04-01  0:00 ` Steve deRosier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=829F632D2F25D411B6920008C716F83114C6EC@dd01-e01.drives.danfoss.dk \
    --to=hans_peter_jepsen@danfoss.com \
    --cc=crossgcc@sources.redhat.com \
    --cc=sderosier@vari-lite.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).