[Firm] Probleme mit cparser
Moritz Kroll
Moritz.Kroll at avira.com
Mon Feb 2 11:24:13 CET 2015
Hi Christoph,
> Nochmal langsam zum Mitschreiben:
> cparser klonen geht, libfirm nicht?
Hier nochmal die Ausgabe von meiner msysgit-Bash (man beachte das erste
Fehlschlagen...):
-----
mkroll at MKROLL-PC-I7 /f/cparser-test
$ git --version
git version 1.9.5.msysgit.0
mkroll at MKROLL-PC-I7 /f/cparser-test
$ git clone http://pp.ipd.kit.edu/git/cparser.git
Cloning into 'cparser'...
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
mkroll at MKROLL-PC-I7 /f/cparser-test
$ git clone http://pp.ipd.kit.edu/git/cparser.git
Cloning into 'cparser'...
remote: Counting objects: 14918, done.
remote: Compressing objects: 100% (4494/4494), done.
remote: Total 14918 (delta 10785), reused 14341 (delta 10343)
Receiving objects: 100% (14918/14918), 2.92 MiB | 0 bytes/s, done.
Resolving deltas: 100% (10785/10785), done.
Checking connectivity... done.
mkroll at MKROLL-PC-I7 /f/cparser-test
$ cd cparser
mkroll at MKROLL-PC-I7 /f/cparser-test/cparser (master)
$ git submodule update --init
Submodule 'libfirm' (http://pp.info.uni-karlsruhe.de/git/libfirm.git/)
registere
d for path 'libfirm'
Cloning into 'libfirm'...
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
Clone of 'http://pp.info.uni-karlsruhe.de/git/libfirm.git/' into
submodule path
'libfirm' failed
mkroll at MKROLL-PC-I7 /f/cparser-test/cparser (master)
$ git submodule update --init
Cloning into 'libfirm'...
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
Clone of 'http://pp.info.uni-karlsruhe.de/git/libfirm.git/' into
submodule path
'libfirm' failed
mkroll at MKROLL-PC-I7 /f/cparser-test/cparser (master)
$ git submodule update --init
Cloning into 'libfirm'...
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
Clone of 'http://pp.info.uni-karlsruhe.de/git/libfirm.git/' into
submodule path
'libfirm' failed
mkroll at MKROLL-PC-I7 /f/cparser-test/cparser (master)
$ git submodule update --init
Cloning into 'libfirm'...
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
Clone of 'http://pp.info.uni-karlsruhe.de/git/libfirm.git/' into
submodule path
'libfirm' failed
-----
Also bei libfirm hat auch hartnäckigkeit nicht geholfen.
>> Sehr schön, jetzt brauch ich keine Spezialdefines mehr und muss nur noch
>> (per Python-Skript) alle ekligen "[source_annotation_attribute( ... )]"
>
> Was für Zeug?
Hier ein Beispiel aus c:\program files (x86)\microsoft visual studio
10.0\vc\include\codeanalysis\sourceannotations.h:
[source_annotation_attribute( SA_Parameter|SA_ReturnValue )]
struct PostBoundAttribute
{
unsigned int Deref;
};
Ich finde, sowas muss man boykottieren ;)
> So MSVC-asm?
> Das ist richtig eklig, da die Semantik von dem Zeug so richtig kaputt ist.
> Vielleicht können wir einen Hack einbauen, damit er das Zeug zumindest
> wegknuspert und in der Codeerzeugung ein abort() fallen lässt. ^^
> Zum Generieren von API-Zeugs reicht das allemal.
Jepp, hier ein Beispiel aus C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\include\winnt.h
__inline ULONGLONG
__stdcall
Int64ShllMod32 (
ULONGLONG Value,
DWORD ShiftCount
)
{
__asm {
mov ecx, ShiftCount
mov eax, dword ptr [Value]
mov edx, dword ptr [Value+4]
shld edx, eax, cl
shl eax, cl
}
}
Schöne Grüße
Moritz
On 02.02.2015 11:13, Christoph Mallon wrote:
> Am 02.02.15 10:02, schrieb Moritz Kroll:
>> Hier die Ergebnisse:
>> - Geupdated von 1.8.0 auf 1.9.5 -> "bad pack header"
>> - pp.ipd.kit.edu für libfirm -> "bad pack header"
>
> Nochmal langsam zum Mitschreiben:
> cparser klonen geht, libfirm nicht?
>
>> Jetzt hatte ich aber das Problem (5.), dass MSVC doppelte Typedefs auch
>> im C-Modus zu erlauben scheint. Ich hab daher noch einen Patch dazu
>> angehängt.
>
> Ab C11 ist das auch in C erlaubt.
> Sollten wir also so oder so einbauen.
>
>> Bisher hatte ich immer einige Problem-Keywords per #define wegdefiniert.
>> Jetzt hab ich __declspec mal scharf geschaltet und ein Problem (6.) mit
>>
>> typedef struct __declspec(align(8)) _XSAVE_AREA_HEADER
>>
>> Ich habe dazu einen Testfall und einen Patch angehängt.
>
> __declspec wird bislang nur sehr halbherzig unterstützt, hauptsächlich
> weil es keiner brauchte.
> Das etwas aufbohren ist nicht falsch.
>
>> Sehr schön, jetzt brauch ich keine Spezialdefines mehr und muss nur noch
>> (per Python-Skript) alle ekligen "[source_annotation_attribute( ... )]"
>
> Was für Zeug?
>
>> Attribute und alle __asm Blöcke rauswerfen. Damit bin ich vollkommen
>> zufrieden :D
>
> So MSVC-asm?
> Das ist richtig eklig, da die Semantik von dem Zeug so richtig kaputt ist.
> Vielleicht können wir einen Hack einbauen, damit er das Zeug zumindest
> wegknuspert und in der Codeerzeugung ein abort() fallen lässt. ^^
> Zum Generieren von API-Zeugs reicht das allemal.
>
> Gruß
> Christoph
>
>
--
Moritz Kroll
Software Developer & Researcher
Advanced Threat Research And Protection Systems
Email: moritz.kroll at avira.com
--
Avira Operations GmbH & Co. KG
Kaplaneiweg 1 | 88069 Tettnang | Deutschland / Germany
Telefon / Telephone: +49 7542-500 0
Telefax / Facsimile: +49 7542-500 3000
Registergericht: Amtsgericht Ulm, HRA 722586 | USt.-IdNr.: DE 815289569 | Pers. haftende Gesellschafterin: Avira OP GmbH | Firmensitz: Tettnang | Registergericht: Amtsgericht Ulm, HRB 726712 | Geschäftsführer: Travis Witteveen
Commercial Register: Amtsgericht Ulm, HRA 722586 | VAT-ID: DE 815289569 | Personally Liable Partner: Avira OP GmbH | Headquarters: Tettnang | Commercial Register: Amtsgericht Ulm, HRB 726712 | Chief Executive Officer (CEO): Travis Witteveen
More information about the Firm
mailing list