[lldb-dev] command line for running the format checker?

2015-10-25 Thread Todd Fiala via lldb-dev
Hi all,

What's the proper command line invocation to run our sources through to get
proper LLVM formatting and other desired fix-ups?

Thanks!

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


[lldb-dev] lldb-gtest scheme and target added to Xcode project

2015-10-25 Thread Todd Fiala via lldb-dev
Hi all,

I've taken a stab at getting the gtests in lldb/unittests to compile and
run on Xcode.  I just checked this in.  There's a new scheme called
lldb-gtest.  If you run that in Xcode, it should build the DebugClang
variant of lldb and link against the gtest libraries that come with clang.
The output goes out to the console when run.

I don't currently have this hooked into any kind of aggregate target yet.
I want to make sure this works everywhere and doesn't break anything before
I make anything depend on it.

I used a public OS X (10.11) and public Xcode (7.1, released this past
week) to do the changes.  Please let me know if you use Xcode and if you
find that this target breaks (perhaps with an older version of Xcode).

I put in a placeholder do-nothing gtest for our Editline code, partially as
a canary to see if I break any of the build bots.  I'll be adding some code
there as soon as I know that I plugged it in right on the cmake side.

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


Re: [lldb-dev] lldb-gtest scheme and target added to Xcode project

2015-10-25 Thread Todd Fiala via lldb-dev
Okay this broke the cmake Linux build.  I'm fixing that now...

On Sun, Oct 25, 2015 at 2:49 PM, Todd Fiala  wrote:

> Hi all,
>
> I've taken a stab at getting the gtests in lldb/unittests to compile and
> run on Xcode.  I just checked this in.  There's a new scheme called
> lldb-gtest.  If you run that in Xcode, it should build the DebugClang
> variant of lldb and link against the gtest libraries that come with clang.
> The output goes out to the console when run.
>
> I don't currently have this hooked into any kind of aggregate target yet.
> I want to make sure this works everywhere and doesn't break anything before
> I make anything depend on it.
>
> I used a public OS X (10.11) and public Xcode (7.1, released this past
> week) to do the changes.  Please let me know if you use Xcode and if you
> find that this target breaks (perhaps with an older version of Xcode).
>
> I put in a placeholder do-nothing gtest for our Editline code, partially
> as a canary to see if I break any of the build bots.  I'll be adding some
> code there as soon as I know that I plugged it in right on the cmake side.
>
> Thanks!
> --
> -Todd
>



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


Re: [lldb-dev] lldb-gtest scheme and target added to Xcode project

2015-10-25 Thread Todd Fiala via lldb-dev
This should be fixed with:
$ svn commit
unittests/Editline/CMakeLists.txt
Transmitting file data .
Committed revision 251264.

On Sun, Oct 25, 2015 at 2:55 PM, Todd Fiala  wrote:

> Okay this broke the cmake Linux build.  I'm fixing that now...
>
> On Sun, Oct 25, 2015 at 2:49 PM, Todd Fiala  wrote:
>
>> Hi all,
>>
>> I've taken a stab at getting the gtests in lldb/unittests to compile and
>> run on Xcode.  I just checked this in.  There's a new scheme called
>> lldb-gtest.  If you run that in Xcode, it should build the DebugClang
>> variant of lldb and link against the gtest libraries that come with clang.
>> The output goes out to the console when run.
>>
>> I don't currently have this hooked into any kind of aggregate target
>> yet.  I want to make sure this works everywhere and doesn't break anything
>> before I make anything depend on it.
>>
>> I used a public OS X (10.11) and public Xcode (7.1, released this past
>> week) to do the changes.  Please let me know if you use Xcode and if you
>> find that this target breaks (perhaps with an older version of Xcode).
>>
>> I put in a placeholder do-nothing gtest for our Editline code, partially
>> as a canary to see if I break any of the build bots.  I'll be adding some
>> code there as soon as I know that I plugged it in right on the cmake side.
>>
>> Thanks!
>> --
>> -Todd
>>
>
>
>
> --
> -Todd
>



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


Re: [lldb-dev] llvm assertion while evaluating expressions for MIPS on Linux

2015-10-25 Thread Bhushan Attarde via lldb-dev
Hi Greg,

I tried using "_$" and "lldb$" as our private prefix, both of these solves the 
issue and works fine for MIPS.

-Regards,
Bhushan

-Original Message-
From: Greg Clayton [mailto:gclay...@apple.com] 
Sent: 23 October 2015 22:29
To: Bhushan Attarde
Cc: lldb-dev@lists.llvm.org
Subject: Re: [lldb-dev] llvm assertion while evaluating expressions for MIPS on 
Linux

What happens if we go with "_$" as our private prefix? Or maybe "lldb$"? Would 
this avoid the issue and fix things for MIPS? I would rather us have a 
consistent private naming scheme across all architectures. Let me know if you 
can try that out and let us know if this works.

Greg

> On Oct 23, 2015, at 5:03 AM, Bhushan Attarde  
> wrote:
> 
> Hi Greg,
> 
> Thanks for your reply.
> 
> There are different temporary symbols for different architectures and file 
> formats.
> As far as I could see, llvm::MCAsmInfo class has a member 
> "PrivateGlobalPrefix" which specifies this temporary symbol.
> The default value for PrivateGlobalPrefix is 'L' (for ELF it is ".L").
> The subclasses of llvm::MCAsmInfo sets PrivateGlobalPrefix to whatever value 
> they want to use for temporary symbol.
> MIPS sets this to "$". (and X86/ARM uses ".L")
> 
> Since the function name "$__lldb_valid_pointer_check" starts with "$" it 
> matches with PrivateGlobalPrefix for MIPS and hence it is marked as temporary.
> Its fine for all x86/x86_64/arm and arm64 variants because they all use 
> symbol other than "$" (i.e ".L") as their PrivateGlobalPrefix.
> 
> As you mentioned we cannot remove "$" from function name because it 
> may conflict with symbols from system libraries or user binaries, so do you 
> think removing C Language linkage from function "$__lldb_valid_pointer_check" 
> can be a solution? or do you have a better solution to this issue?
> 
> Regards,
> Bhushan
> 
> 
> -Original Message-
> From: Greg Clayton [mailto:gclay...@apple.com]
> Sent: 20 October 2015 23:56
> To: Greg Clayton
> Cc: Bhushan Attarde; lldb-dev@lists.llvm.org
> Subject: Re: [lldb-dev] llvm assertion while evaluating expressions 
> for MIPS on Linux
> 
> My guess is that there is a different temporary symbol for differing 
> architectures and possibly depending on which file format (mach-o or ELF) you 
> are targeting. MIPS probably happens to use '$'. I know mach-o files use "L" 
> as the temporary symbol prefix, ELF tends to use '.'. Not sure where this 
> would be abstracted in LLVM or if it is just built into the assemblers 
> directly for each arch... If you can find out where this can be detected 
> within LLVM, we can make sure we don't use any temporary prefixes in symbol 
> names and work around this issue. We need to make sure that any functions we 
> generate and JIT up and insert into the program do not conflict with _any_ 
> symbol that could be in any system libraries or user binaries. This is why we 
> used '$' in the first place.
> 
> Greg
> 
>> On Oct 20, 2015, at 11:11 AM, Greg Clayton via lldb-dev 
>>  wrote:
>> 
>> What is this not happening on any other architecture? Is the "$" special for 
>> MIPS and not for other architectures? We really don't want to remove the '$' 
>> as we want the symbol to be unique. The '$' symbol is fine for all 
>> x86/x86_64/arm and arm64 variants...
>> 
>> Greg
>> 
>> 
>>> On Oct 19, 2015, at 11:30 PM, Bhushan Attarde via lldb-dev 
>>>  wrote:
>>> 
>>> Hi,
>>> 
>>> I am facing issue (llvm assertion) in evaluating expressions for MIPS on 
>>> Linux.
>>> 
>>> (lldb) p fooptr(a,b)
>>> lldb: /home/battarde/git/llvm/lib/MC/ELFObjectWriter.cpp:791: void 
>>> {anonymous}::ELFObjectWriter::computeSymbolTable(llvm::MCAssembler&, const 
>>> llvm::MCAsmLayout&, const SectionIndexMapTy&, const RevGroupMapTy&, 
>>> {anonymous}::ELFObjectWriter::SectionOffsetsTy&): Assertion `Local || 
>>> !Symbol.isTemporary()' failed.
>>> 
>>> I debugged it and found that, LLDB inserts calls to dynamic checker 
>>> function for pointer validation at appropriate locations in expression’s IR.
>>> 
>>> The issue is that this checker function’s name (hard-coded in LLDB in 
>>> lldb\source\Expression\IRDynamicChecks.cpp) starts with “$” i.e 
>>> “$__lldb_valid_pointer_check”.
>>> While creating a MCSymbol (MCContext::createSymbol() in
>>> llvm/lib/MC/MCContext.cpp) for this function llvm detects the name starts 
>>> with “$” and marks that symbol as ‘temporary’ symbol (PrivateGlobalPrefix 
>>> is '$' for MIPS) Further while computing a symbol table in 
>>> ELFObjectWriter::computeSymbolTable() the assertion triggers because this 
>>> symbol is 'temporary'.
>>> 
>>> I tried couple of things that solves this issue for MIPS.
>>> 
>>> 1. Remove '$' from the function name.
>>> 2. Remove "C Language linkage" from the dynamic pointer validation 
>>> function i.e the below piece of code in 
>>> lldb\source\Expression\IRDynamicChecks.cpp
>>> 
>>> - static const char g_valid_pointer_check_text[]