Re: [Tinycc-devel] [PATCH] Re: using gdb 6.6 on linux fail after dec18 2013

2015-01-04 Thread Sergey Korshunoff
A patch is applied to solve this bug. 2015-01-04 8:58 GMT+03:00, Sergey Korshunoff : > After a previous patch applied... > Bug: a line number declaration (# NUM xxx "file_name") is not used > when generating a debug info. A test case: precompile your project > files with tcc and then use a precomp

[Tinycc-devel] [BUG] tcc and INT64: wrong result of comparison (a test included)

2015-01-04 Thread Sergey Korshunoff
HI! A test attached is a snippet code from a nimrod compiler. Currenly tcc fails to compile it rigth. #include typedef long long int NI64; int main() { NI64 res = 0; printf("Test for comparing a INT64 values: "); if (res < -2147483648LL) { printf("Error: 0 < -2147483648\n"); return

Re: [Tinycc-devel] [PATCH] Re: using gdb 6.6 on linux fail after dec18 2013

2015-01-04 Thread Thomas Preud'homme
Le dimanche 4 janvier 2015, 08:10:40 Sergey Korshunoff a écrit : > Return back a grischka patch which lost after > "Split elf_output_file in smaller functions" > > Author: grischka > Date: Tue Feb 5 21:18:29 2013 +0100 > tccelf: fix debug section relocation > With: >tcc -g hello.c >

Re: [Tinycc-devel] [PATCH] Re: using gdb 6.6 on linux fail after dec18 2013

2015-01-04 Thread Thomas Preud'homme
Le dimanche 4 janvier 2015, 11:04:22 Sergey Korshunoff a écrit : > A patch is applied to solve this bug. Hi Sergey, Shouldn't file->line_num be passed as the last parameter of put_stabs? Best regards, Thomas ___ Tinycc-devel mailing list Tinycc-devel

Re: [Tinycc-devel] [PATCH] pp-defines

2015-01-04 Thread Thomas Preud'homme
Le dimanche 4 janvier 2015, 07:53:44 Sergey Korshunoff a écrit : > > This patch seems unnecessary as tcc_define_symbol with a third argument > > NULL is equivalent as setting it to 1 (#define FOO is the same as #define > > FOO 1) > I trying to be exactly the same as gcc. And this macros in gcc ar

Re: [Tinycc-devel] [PATCH] Re: using gdb 6.6 on linux fail after dec18 2013

2015-01-04 Thread Sergey Korshunoff
Yes, you are right. I'm lost the ground trying to detect a point after which debugger don't do the work. tcc v0.9.25 was working. After a grischka patch a debugger don't work. And exactly with the same symptom: gdb refused to know "main".I don't understand why, sorry. Did gdb work for you w/o a pa

Re: [Tinycc-devel] [PATCH] Re: using gdb 6.6 on linux fail after dec18 2013

2015-01-04 Thread Sergey Korshunoff
May be yes. I don't found a code where a line info is passed to the put_stabs... 2015-01-04 16:49 GMT+03:00, Thomas Preud'homme : > Le dimanche 4 janvier 2015, 11:04:22 Sergey Korshunoff a écrit : >> A patch is applied to solve this bug. > > Hi Sergey, > > Shouldn't file->line_num be passed as the

Re: [Tinycc-devel] [BUG] tcc and INT64: wrong result of comparison (a test included)

2015-01-04 Thread Sergey Korshunoff
By replacing a -2147483648 with a -2147483647 I can succesfully build a working nim compiler. But this is not so good... 2015-01-04 12:45 GMT+03:00, Sergey Korshunoff : > HI! A test attached is a snippet code from a nimrod compiler. Currenly > tcc fails to compile it rigth. __

Re: [Tinycc-devel] [PATCH] allow to tell a target ARCH to a configure script

2015-01-04 Thread Sergey Korshunoff
As suggested on another forum, there is a "setarch linux32" command for changing ARCH reported by "uname -m". 2015-01-04 2:45 GMT+03:00, Thomas Preud'homme : > Le mardi 30 décembre 2014, 11:05:15 Sergey Korshunoff a écrit : >> Problem: configure in 32bit userspace running on 64bit kernel is >> try

Re: [Tinycc-devel] [BUG] tcc and INT64: wrong result of comparison (a test included)

2015-01-04 Thread Thomas Preud'homme
Le dimanche 4 janvier 2015, 19:18:34 Sergey Korshunoff a écrit : > By replacing a -2147483648 with a -2147483647 I can succesfully build > a working nim compiler. But this is not so good... The bug is in tccpp.c parse_number. The function tries to guess what should be the size and sign of the lit

Re: [Tinycc-devel] [BUG] tcc and INT64: wrong result of comparison (a test included)

2015-01-04 Thread Sergey Korshunoff
It is possible to correct a case for -2147483648 ? A code generated by tcc and gcc is attached. 2015-01-04 19:18 GMT+03:00, Sergey Korshunoff : > By replacing a -2147483648 with a -2147483647 I can succesfully build > a working nim compiler. But this is not so good... > > 2015-01-04 12:45 GMT+03:

Re: [Tinycc-devel] [PATCH] Don't break compilation process with unknow option

2015-01-04 Thread RoboTux
Le 2015-01-04 04:42, Sergey Korshunoff a écrit : GCC and clang also error out for unknown option. What option caused your program to fail to compile? The patch is for the case with -Wunsupported. In such case a user will is "Don't trap, only warning". There are many gcc options which tcc don't

[Tinycc-devel] Creating a debugger for my own language, in TinyCC?

2015-01-04 Thread John Smith
Hi people... Is it possible to create a debugger, for my own (Secret) programming language using TinyCC? I'll spare you the long details (unless you need it)... but here goes as short as I can... So... let's imagine... I'm converting high-level code into C code. Then... in this C code... I wa

Re: [Tinycc-devel] [BUG] tcc and INT64: wrong result of comparison (a test included)

2015-01-04 Thread Sergey Korshunoff
There is another approach: assume the constant is negative by default. This is the method used in nimrod to scan a constants: lib/pure/parseutils.nim(rawparse) proc rawParseInt(s: string, b: var BiggestInt, start: int = 0): int = var sign: BiggestInt = -1 # minus by defaul

Re: [Tinycc-devel] [PATCH] pp-defines

2015-01-04 Thread Charles Gordon
On 4 janv. 2015, at 15:10, Thomas Preud'homme wrote: > Le dimanche 4 janvier 2015, 07:53:44 Sergey Korshunoff a écrit : >>> This patch seems unnecessary as tcc_define_symbol with a third argument >>> NULL is equivalent as setting it to 1 (#define FOO is the same as #define >>> FOO 1) >> I trying