search for: karthikthecool

Displaying 10 results from an estimated 10 matches for "karthikthecool".

2012 Dec 06
2
[LLVMdev] Value of structure passed byval to a recurse function not initialized when accessed through GDB
...'ll > notice when you "break recurse" that it's not breaking on a line or > source file, just an address) it's breaking at the very start, before > the prologue > > I'm about to commit a fix to this. > > On Tue, Dec 4, 2012 at 5:34 AM, Karthik Bhat <karthikthecool at gmail.com> wrote: >> Hi All, >> >> I was debugging a clang binary when i found this problem. The >> following code is complied with clang. >> >> typedef struct s >> { >> short s; >> } SVAL; >> >> >> void recurse (SVAL a...
2012 Dec 06
0
[LLVMdev] Value of structure passed byval to a recurse function not initialized when accessed through GDB
On Thu, Dec 6, 2012 at 12:33 AM, Karthik Bhat <karthikthecool at gmail.com> wrote: > Hi David, > > I think it might not be exactly PR13303 which might be causing the > corruption of struct when accessed through GDB. > This seems to be an ABI problem in clang. > The problem seems to be that when we have pass by value of struct > (having...
2012 Dec 04
4
[LLVMdev] Value of structure passed byval to a recurse function not initialized when accessed through GDB
Hi All, I was debugging a clang binary when i found this problem. The following code is complied with clang. typedef struct s { short s; } SVAL; void recurse (SVAL a, int depth) { a.s = --depth; if (depth == 0) return; else recurse(a,depth); } int main () { SVAL s; s.s = 5; recurse (s, 5); return 0; } When i try to access value of a.s in function recurse through gdb(i.e
2012 Dec 05
1
[LLVMdev] Value of structure passed byval to a recurse function not initialized when accessed through GDB
...t right at every instruction boundary, and the fact that what's being passed is a structure, but one that is less than an integer in size, may be exposing a bug in DWARF generation, not code generation. > Just a thought. > Richard > > On Dec 4, 2012, at 5:34 AM, Karthik Bhat <karthikthecool at gmail.com> wrote: > >> Hi All, >> >> I was debugging a clang binary when i found this problem. The >> following code is complied with clang. >> >> typedef struct s >> { >> short s; >> } SVAL; >> >> >> void recurse (SV...
2012 Dec 04
0
[LLVMdev] Value of structure passed byval to a recurse function not initialized when accessed through GDB
...tion based on the debug info (you'll notice when you "break recurse" that it's not breaking on a line or source file, just an address) it's breaking at the very start, before the prologue I'm about to commit a fix to this. On Tue, Dec 4, 2012 at 5:34 AM, Karthik Bhat <karthikthecool at gmail.com> wrote: > Hi All, > > I was debugging a clang binary when i found this problem. The > following code is complied with clang. > > typedef struct s > { > short s; > } SVAL; > > > void recurse (SVAL a, int depth) > { > a.s = --depth; >...
2012 Dec 04
0
[LLVMdev] Value of structure passed byval to a recurse function not initialized when accessed through GDB
...s some effort to get right at every instruction boundary, and the fact that what's being passed is a structure, but one that is less than an integer in size, may be exposing a bug in DWARF generation, not code generation. Just a thought. Richard On Dec 4, 2012, at 5:34 AM, Karthik Bhat <karthikthecool at gmail.com> wrote: > Hi All, > > I was debugging a clang binary when i found this problem. The > following code is complied with clang. > > typedef struct s > { > short s; > } SVAL; > > > void recurse (SVAL a, int depth) > { > a.s = --depth; &g...
2012 Nov 29
1
[LLVMdev] clang modifying clobbered register in case of inline assembly resulting in data corruption
Hi All, I'm looking into this simple inline assembly code. Were we copy contents on data to eax,ebx,ecx and edx and later copy them back from the registers to data. Test Case - #include <stdio.h> int data[] = { 0x14131211, 0x24232221, 0x34333231, 0x44434241, }; int main (int argc, char **argv) { asm ("mov 0(%0), %%eax\n\t" "mov 4(%0), %%ebx\n\t"
2012 Nov 15
0
[LLVMdev] Unable to call a function in GDB when build with -fPIE
Hi All, I compiled the following code on my linux PC using clang with PIE option- struct struct4 {char a; char b; char c; char d; }; struct struct4 foo4 = {'a','2','c','4'}; struct struct4 fun4() { return foo4; } int main() { fun4(); return 0; } > clang -g -fPIE structs.c In GDB session when i call p/c fun4() i get something like below- (gdb) p/c
2013 Jan 11
0
[LLVMdev] Static analysis across across translation units
Hi All, I was going through projects in clang and stumbled across Static analyzer in clang which seems to be quite interesting. But it seems static analyzer currently does one translation unit at a time and currently there is no support for inter procedural analysis across translation unit. Current design seems to process one file at a time. Is there any plan to extent it to support inter
2012 Oct 01
2
[LLVMdev] Wrong type qualifier for this pointer in case of ARM compiled binary
Hi All, Was looking into a simple program - class Simple { public: void fun() {} }; int main() { Simple s; s.fun(); return 0; } When compiled using clang++ for ARM- Expected result when we run - print Simple::fun in GDB is void fun(Simple* const this) as this should be a const pointer but in case of arm compiled binary we get void fun(Simple* this). Works fine when compiled using