From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jepsen Hans Peter To: 'Steve deRosier' , crossgcc Subject: RE: crossgcc debug with HP emulator Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-ID: <829F632D2F25D411B6920008C716F83114C6EC@dd01-e01.drives.danfoss.dk> X-SW-Source: 2001-q1/msg00058.html Content-type: multipart/mixed; boundary="----------=_1583532681-65081-43" Message-ID: <20010401000000.vq0hmgyNkxbHUldwLgOU5hR5LU7qrnfOrEs9LFPW5PY@z> This is a multi-part message in MIME format... ------------=_1583532681-65081-43 Content-length: 2697 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); ------------=_1583532681-65081-43 Content-Type: application/x-gzip; charset=binary; name="toplev.c.patch.gz" Content-Disposition: inline; filename="toplev.c.patch.gz" Content-Transfer-Encoding: base64 Content-Length: 1103 H4sICMoSWzoCA3RvcGxldi5jLnBhdGNoAL1U227aQBB9hq+YUKkBY4NtUAgg KqE2rVIVUjXJU1VZiz02q9hryxeaKOLfO7vLXYki5aErhL1znzNnbBgGYOQX ltNxFt3I97tlmsW46vidNOdR7bYSMGNPAC649qg/GDl9cIbDYd2yrFcca7NU wHfycx2whyP7YtS3tY9xfOQdBq5jDtwLUAIZVAl6DtC7VQd5eAgs5qwAJlj8 VPACmlxAhAJzFreA7ijYIsagA2B0yYeLEsKYRV5R5twvPeXNRQQTsMekr7eh a4AVPiBmVshjtDJWLsFnVYEFlEsEKYSA5+iXfIUUUEnTqsyqUunKFBaohIIl SAHpRGQqINW2fpokTAQxF2gCR2CQpUXBF7u4af4EKi3VL9ISckzSFfWgY83T PGFxN8CQVXFJuZZsxdNcGlNq2Vem0qgI1HRbNS0b8mR9npKrdttAHeNjibnY AxNUSeZVQlTJAnMMFCj0e2lAQ/vSHDq9/YDoYg5d+2BAjW9qFqXsOlDY+Ev0 HwBXSE0m1Bg9mO9jUTRgbS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