Hi Grischka,
Thank you for this very useful contribution. I have however a concern on the
way you load the different new files:
+#ifdef CONFIG_TCC_BACKTRACE
+ if (s1->do_backtrace) {
+#ifdef CONFIG_TCC_BCHECK
+ if (s1->do_bounds_check && s1->output_type != TCC_OUTPUT_DLL)
+ tcc_add_support(s1, "bcheck.o");
+#endif
+ if (s1->output_type == TCC_OUTPUT_EXE)
+ tcc_add_support(s1, "bt-exe.o");
+ if (s1->output_type == TCC_OUTPUT_DLL)
+ tcc_add_support(s1, "bt-dll.o");
+ if (s1->output_type != TCC_OUTPUT_DLL)
+ tcc_add_support(s1, "bt-log.o");
+ if (s1->output_type != TCC_OUTPUT_MEMORY)
+ tcc_add_btstub(s1);
+ }
+#endif
It supposes that there is only one memory model (either 32 or 64). More
specifically, it prevents tcc to support multi-archive using -m32/-m64.
IMHO, it would be better to build libbcheck.a (or whatever name you like) which
contains all material to support bound checking and bt.
Multi-archive will internally use libbcheck-32.a and libbcheck-64.a
Wdyt?
C.
-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden] On
Behalf Of grischka
Sent: Friday, January 17, 2020 23:22
To: address@hidden
Subject: [Tinycc-devel] standalone backtraces
Hi folks,
Thought the entire bcheck stuff is pretty much completely useless
if it doesn't give you any hint where in the your code the problem
actually happens. So I added some patch of mine that allows tcc to
include the backtrace features for -run into standalone executables.
It should work with DLLs/SOs too (i.e. multiple instances of stab
debug infos). See
https://repo.or.cz/tinycc.git/commitdiff/ef42295f
--- grischka
_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel