|
From: Sev B. <se...@bn...> - 2005-01-13 16:08:33
|
32c32,33
<
---
> #include <string.h>
> #include <stdio.h>
105a107
>
246a249,250
> Char ** dnames = NULL; //sev - create a dir table
> UInt last_dir_entry = 0; //sev - and keep an index
337a342,343
>
> /*
339c345,346
< {
---
> {
> UChar * name;
341c348,375
< }
---
>
> }
> */
>
> //sev - lets not ignore dir
> // lets save them so we can use them later to create the full
> // path
> while (* data != 0)
> {
> UChar * name;
>
> ++ last_dir_entry;
>
> name = data;
>
> /* Since we don't have realloc (0, ....) == malloc (...)
> semantics, we need to malloc the first time. */
>
> if (dnames == NULL)
> dnames = VG_(arena_malloc)(VG_AR_SYMTAB, sizeof (UInt) * 2);
> else
> dnames = VG_(arena_realloc)(VG_AR_SYMTAB, dnames, /*alignment*/4,
> sizeof(UInt) * (last_dir_entry + 1));
> data += VG_(strlen) ((Char *) data) + 1;
> dnames[last_dir_entry] = VG_(addStr) (si,name, -1);
> /* printf("dir = %s \n", dnames[last_dir_entry]); */
> }
> /* printf("***************************\n"); */
362a397,398
> /*sev*/
>
363a400
> /*printf("file = %s \n", name); */
374d410
< fnames[state_machine_regs.last_file_entry] = VG_(addStr) (si,name, -1);
376c412,417
< read_leb128 (data, & bytes_read, 0);
---
> //sev - what I need to do here is concatenate the dir
> //from above with name & pass it in
>
> // fnames[state_machine_regs.last_file_entry] = VG_(addStr) (si,name, -1);
>
> unsigned int dirindex = read_leb128 (data, & bytes_read, 0);
381a423,444
>
> {
> /* sev -- append the dir name to file name and save */
> /*printf("dirindex = %u \n", dirindex ); */
> if (dirindex > last_dir_entry ) printf("dirindex too large \n");
> char fullname[2000];
> fullname[0] = '\0';
> if ((dirindex <=0) || (dirindex > last_dir_entry) )
> {/* if dont have a dir name then skip it */
> /*printf("dirindex <= 0 \n"); */
> strcpy(fullname, name);
> }
> else
> {
> /*printf("dirnameB %s\n", dnames[dirindex ]); */
> sprintf(fullname,"%s/",dnames[dirindex]);
> strcat(fullname, name);
> }
> /* printf( "fullname = %s \n", fullname); */
> fnames[state_machine_regs.last_file_entry] = VG_(addStr) (si, fullname, -1);
> /*printf("***************************\n"); */
> }
384a448,452
> //sev - clean up dir structure and index
> VG_(arena_free)(VG_AR_SYMTAB, dnames);
> dnames = NULL;
> last_dir_entry = 0;
>
530a599
>
|
|
From: Tom H. <th...@cy...> - 2005-01-17 10:37:45
|
In message <41E...@bn...>
Sev Binello <se...@bn...> wrote:
> A while back I posted the message below indicating that Valgrind
> was not producing the
> full path for source code built with gcc 3.2.3
> I took a look at the code and found that vg_dwarf.c expected gcc
> to include the path in the file name,
> if it was using dwarf2 debug format.
> Therefor, it never bothered to look for the path in the directory
> table for files in dwarf2 format.
> It doesn't look like that assumption is correct.
> I modified the code in vg_dwarf.c to parse the directory table,
> and concatenate the path name to the file name.
> I've attached a patch file. It does not handle relative paths.
You have approached the problem from the wrong direction - valgrind
was never supposed to print the full path. It was an accident that
old gcc's put the full path in like that - other debug formats only
print the leafname.
There was a long discussion about this before when somebody wanted
the full path and consensus seemed to be against it except perhaps
as an option.
Patches are best filed in the bug tracker anyway - they are less
likely to get lost/forgotten that way.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Julian S. <js...@ac...> - 2005-06-03 02:04:43
|
> On Monday 17 January 2005 10:37, Tom Hughes wrote: > > Sev Binello <se...@bn...> wrote: > > A while back I posted the message below indicating that Valgrind > > was not producing the > > full path for source code built with gcc 3.2.3 > > [...] > > There was a long discussion about this before when somebody wanted > the full path and consensus seemed to be against it except perhaps > as an option. Tom -- where is this discussion? I'd like to re-read it, but I can't find it. J |
|
From: Tom H. <to...@co...> - 2005-06-03 09:58:42
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
>> On Monday 17 January 2005 10:37, Tom Hughes wrote:
>>
>> Sev Binello <se...@bn...> wrote:
>> > A while back I posted the message below indicating that Valgrind
>> > was not producing the
>> > full path for source code built with gcc 3.2.3
>> > [...]
>>
>> There was a long discussion about this before when somebody wanted
>> the full path and consensus seemed to be against it except perhaps
>> as an option.
>
> Tom -- where is this discussion? I'd like to re-read it, but I can't
> find it.
Good question, but not the easiest to answer with sourceforge's
appalling archive interface ;-)
There is bug 85050 and a various related threads on the developer list
from last year entitled:
"dwarf2+valgui update"
"Time for 2.2.0"
"Last call for 2.2.0"
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|