Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] Problems with mangled C symbols without namespace

Hi Andreas,

 

I have reverted changes in that patch.

 

It was supposed to be an optimization, but, apparently, it causes regression in C++ handling.

 

Thanks,

Eugene

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Ragnerstam, Andreas
Sent: Friday, January 27, 2017 6:06 AM
To: TCF Development
Subject: Re: [tcf-dev] Problems with mangled C symbols without namespace

 

Hi again, sorry for the spamming,

 

So after even further investigation I will rephrase my question problems in to a new question. You can disregard from the last questions.

 

Is there any way to find a local variable or function, that has mangled symbols, without specifying the ip of its unit? I would like to do something like find_symbol_by_name(ctx, -1, 0, “foo”, &sym) to find any symbol named “foo”, even if it is static in a .c file. This used to work before the “TCF Agent: fixed: static C/C++ variables should not be added into public name table of the DWARF reader” patch. Now the behavior is different depending on if the symbol has mangled symbols or not. Compiling with a gcc compiler will work, while compiling with g++ will not work for the following function in a c file:

 

static int foo(int a) {

    return a + 1;

}

 

Best regards and sorry again for the spamming,

Andreas Ragnerstam

 

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Ragnerstam, Andreas
Sent: Friday, January 27, 2017 1:08 PM
To: TCF Development <tcf-dev@xxxxxxxxxxx>
Subject: Re: [tcf-dev] Problems with mangled C symbols without namespace

 

Hi again,

Seems like I looked at the wrong patch.

The patch causing for us is actually “TCF Agent: fixed: static C/C++ variables should not be added into public name table of the DWARF reader” which specifies that this is for C as well. And this seems to do what it says.

 

The problem still exists though. Statically declared global symbols that were previously found can no longer be found. Any suggestions on how to fix this are welcome.

 

Best Regards,

Andreas Ragnerstam

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Ragnerstam, Andreas
Sent: Friday, January 27, 2017 10:50 AM
To: tcf-dev@xxxxxxxxxxx
Subject: [tcf-dev] Problems with mangled C symbols without namespace

 

Hi,

We are seeing some issues with finding symbols after updating the TCF agent, because of an one year old fix for name spaces in C++.

 

The fix “TCF Agent: Symbols Service: fixed search of definition for a declaration in a name space in C++” introduced a requirement for a namespace tag in the symbols unit in order to add Dwarf symbols with add_pub_names from create_pub_names (in dwarfcache.c).

We see a case were a GHS C compiler mangles symbols (they are named something like foo..2Fpath1..2Fpath. for the symbol foo) but the compile unit (or any unit) does not contain any DW_TAG_namespace. Previous to the mentioned fix the symbol would be found when searching for ‘foo’ as it could be found as that in the Dwarf information. After this fix that symbol is no longer found.

 

My question is that in that add_namespace function (in dwarfcache.c) there is an exception for the ADA95 language (ns->mCompUnit->mLanguage == LANG_ADA95), should not the namespace requirement just apply to C++? Or does this apply to other languages (the patch indicates that this is just for C++)? Changing that line to “ns->mCompUnit->mLanguage =! LANG_C_PLUS_PLUS” or adding exceptions for the different C languages in dwarf.h would solve our problem.

 

Best Regards,

Andreas Ragnerstam

 

----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


Back to the top