This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compile: objfiles lifetime UI


On Thu, 30 Apr 2015 12:53:49 +0200, Jan Kratochvil wrote:
> What about that 2nd case example of:
> 	(gdb) compile code str = "bar";
> That can be also typed as the 1st case:
> 	(gdb) compile print str = "bar"
> Obviously "bar" remains the GDB-mmap()ed memory.

Maybe it would be best if GCC can report whether the compiled code exposes
address to its internal object outside - such as by such an assignment or by
passing such a pointer to some external function.  I expect some scan of the
IR (intermediate representation - RTL/GIMPLE?) would be sufficient.

IMO for 99% of such compiled code it will not happen and therefore GDB can
quietly and safely discard such injected objfile from the inferior.

It is questionable how many false positives would such a scan-for-address-of
make.


Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]