This is the mail archive of the gdb-prs@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]

[Bug breakpoints/16551] Execution stops when encountering a dprintf with an invalid string


https://sourceware.org/bugzilla/show_bug.cgi?id=16551

--- Comment #2 from Marc Khouzam <marc.khouzam at ericsson dot com> ---
(In reply to Antoine Tremblay from comment #1)

> The expectation of the developer should be that if a command input is wrong,
> gdb
> can't do what the user requested and control is returned to the developer
> to fix the error.

Ok, that makes sense.

> I'm also uncertain about what you mean by the stopped event beeing missed ?

I think a dprintf is treated as an internal breakpoint, so when one is hit,
there is no *stopped event that Eclipse can see.  This makes sense because we
expect the execution to resume.  However, in this case, the execution of the
thread that hit the dprintf stayes suspended but we don't notify eclipse (with
a *stopped event) so eclipse still shows everything as running, and things get
stuck.

> Also bug 15185 would not fix the isssue since we can only know about the bad
> symbol at the runtime of that line since shared libraries could be loaded
> dynamicaly thus we can't prevalidate the dprintf input as we enter it.

It does seem like it would not be possible, but gdb is able to do some checking
when we set conditions.  I was hoping we could do something similar?  I'll put
a note in the relevant bug:

(gdb) b 9 if ii<0
No symbol "ii" in current context.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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