Re: compile: objfiles lifetime UI
Jan Kratochvil <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
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