Re: [lldb-dev] LLDB expressions confused by overloading

2015-11-12 Thread Greg Clayton via lldb-dev

> On Nov 5, 2015, at 9:43 AM, Aidan Dodds via lldb-dev 
>  wrote:
> 
> I believe I have tracked down an interesting bug which related to LLDBs 
> expression parser.
> 
> In my target program I have a math library, a shared object which makes use 
> of clangs __attribute__((overloadable)) extension for C99.  This causes the 
> the function names in the math library to be mangled.
> A problem arises however since some of the function names mirror those 
> exported by libm.so, and the function names in libm are not mangled.
> 
> My problem scenario:
> If I call an expression during a debugging session, the symbol table of 
> libm.so is consulted first and a match will be found.  Later on in the 
> expression setup, any dwarf information will be consulted for functions with 
> this name.  libm.so doesn't have any debugging info attached, however the 
> math library of my target may.  In this case the expression will now call 
> which ever function it could first find dwarf info for, regardless of the 
> name mangling.
> 
> The net result is that a function will be called in my targets math library 
> that may not match the given function signature.  In my case this causes the 
> expression to raise a SEGFAULT and fail.  I was seeing an expression to call 
> a vector4 function, in fact call the vector 2 version behinds the scenes.
> 
> One solution to this problem seems to be to have the expression evaluator try 
> and first look for any functions that may have a mangled name for the given 
> function signature, and if that fails fall back to simply checking for the 
> unmangled version, as is currently done.
> 
> Would this make sense?
> 
> It seems less then ideal to have a clash of mangled and unmangled names, but 
> I can imagine this situation may not be all that rare.

The correct fix for this is to have the DWARFASTParserClang, when it parses the 
function prototype, recognize that a C function (check the language of the 
compile unit) has a mangled name and enable the corresponding bit in the 
clang::FunctionType so that the expression parser knows to look for the mangled 
name when someone uses it. Then no changes to the expression parser should be 
required.

Greg Clayton

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] How to disassemble a section (python api)?

2015-11-12 Thread kwadwo amankwa via lldb-dev

Hi
I'm writing a small script and need to disassemble a whole section , 
what would be the correct way to go about it ?


Cheers Que,
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] Two CLs requiring changes to the Xcode project

2015-11-12 Thread Zachary Turner via lldb-dev
Hi all,

I submitted r252993 and 252994.  These changes will require a corresponding
change in the Xcode workspace.  Would anyone mind making those changes for
me?  It should be pretty simple, just need to add a .cpp and .h file to the
gtest target for ScriptInterpreterPythonTests, and add
PythonExceptionState.cpp to Plugins/ScriptInterpreter/Python
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Two CLs requiring changes to the Xcode project

2015-11-12 Thread Jason Molenda via lldb-dev
Done in r252998.

I didn't see anything in the xcode project file about a gtest target.

J

> On Nov 12, 2015, at 5:39 PM, Zachary Turner via lldb-dev 
>  wrote:
> 
> Hi all,
> 
> I submitted r252993 and 252994.  These changes will require a corresponding 
> change in the Xcode workspace.  Would anyone mind making those changes for 
> me?  It should be pretty simple, just need to add a .cpp and .h file to the 
> gtest target for ScriptInterpreterPythonTests, and add 
> PythonExceptionState.cpp to Plugins/ScriptInterpreter/Python
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Two CLs requiring changes to the Xcode project

2015-11-12 Thread Zachary Turner via lldb-dev
Hmm, can you ask Todd about it?  He said he added one, but I'm not sure how
it works.

On Thu, Nov 12, 2015 at 5:46 PM Jason Molenda  wrote:

> Done in r252998.
>
> I didn't see anything in the xcode project file about a gtest target.
>
> J
>
> > On Nov 12, 2015, at 5:39 PM, Zachary Turner via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >
> > Hi all,
> >
> > I submitted r252993 and 252994.  These changes will require a
> corresponding change in the Xcode workspace.  Would anyone mind making
> those changes for me?  It should be pretty simple, just need to add a .cpp
> and .h file to the gtest target for ScriptInterpreterPythonTests, and add
> PythonExceptionState.cpp to Plugins/ScriptInterpreter/Python
> > ___
> > lldb-dev mailing list
> > lldb-dev@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Two CLs requiring changes to the Xcode project

2015-11-12 Thread Jason Molenda via lldb-dev
Ah, my bad.  It's the lldb-gtest target.


> On Nov 12, 2015, at 5:49 PM, Zachary Turner  wrote:
> 
> Hmm, can you ask Todd about it?  He said he added one, but I'm not sure how 
> it works.
> 
> On Thu, Nov 12, 2015 at 5:46 PM Jason Molenda  wrote:
> Done in r252998.
> 
> I didn't see anything in the xcode project file about a gtest target.
> 
> J
> 
> > On Nov 12, 2015, at 5:39 PM, Zachary Turner via lldb-dev 
> >  wrote:
> >
> > Hi all,
> >
> > I submitted r252993 and 252994.  These changes will require a corresponding 
> > change in the Xcode workspace.  Would anyone mind making those changes for 
> > me?  It should be pretty simple, just need to add a .cpp and .h file to the 
> > gtest target for ScriptInterpreterPythonTests, and add 
> > PythonExceptionState.cpp to Plugins/ScriptInterpreter/Python
> > ___
> > lldb-dev mailing list
> > lldb-dev@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> 

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Two CLs requiring changes to the Xcode project

2015-11-12 Thread Zachary Turner via lldb-dev
Thanks!  I actually forgot, there's one more file for the lldb-gtest
target.  It's PythonExceptionStateTests.cpp.

Thanks for the help

On Thu, Nov 12, 2015 at 6:05 PM Jason Molenda  wrote:

> Ah, my bad.  It's the lldb-gtest target.
>
>
> > On Nov 12, 2015, at 5:49 PM, Zachary Turner  wrote:
> >
> > Hmm, can you ask Todd about it?  He said he added one, but I'm not sure
> how it works.
> >
> > On Thu, Nov 12, 2015 at 5:46 PM Jason Molenda 
> wrote:
> > Done in r252998.
> >
> > I didn't see anything in the xcode project file about a gtest target.
> >
> > J
> >
> > > On Nov 12, 2015, at 5:39 PM, Zachary Turner via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> > >
> > > Hi all,
> > >
> > > I submitted r252993 and 252994.  These changes will require a
> corresponding change in the Xcode workspace.  Would anyone mind making
> those changes for me?  It should be pretty simple, just need to add a .cpp
> and .h file to the gtest target for ScriptInterpreterPythonTests, and add
> PythonExceptionState.cpp to Plugins/ScriptInterpreter/Python
> > > ___
> > > lldb-dev mailing list
> > > lldb-dev@lists.llvm.org
> > > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> >
>
>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev