This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Turn on dbg msg of IPA along with gdbserver's
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <alves dot ped at gmail dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 4 Jan 2012 22:55:10 +0800
- Subject: Re: [patch] Turn on dbg msg of IPA along with gdbserver's
- References: <4F03CA12.7050304@codesourcery.com> <4F043FC6.3070201@gmail.com>
On 01/04/2012 08:02 PM, Pedro Alves wrote:
> Since it's in the inferior, I just do "print debug_threads = 1"
> from gdb. It won't work if the ipa is stripped though, so I won't
> object to something like this.
>
Well, I don't mind to turn debug flag on in this way. However,
`debug_threads' is confusing here. How about change this flag to
`debug_agent'?
>> Since gdbserver has been a good
>> mechanism to access gdb_agent_XXX variables in inferior's space, we can
>> do similar thing to turn on IPA's debug flag.
>>
>> This patch renames debug flag `debug_threads' to `gdb_agent_debug', and
>> let gdbserver to set it if `debug_threads' (in gdbserver's space) is
>> true. For the user's perspective, if gdbserver option --debug is on,
>> IPA's debugging message comes into the gdbserver's debug message.
>>
>> OK for mainline?
>
> Sorry, not in this form. It's quite useful to be able to turn
> gdbserver's and the IPA's debug output independently. I'd like to
> retain that possibility.
That is fine to me. It is reasonable to decouple gdbserver's and IPA's
debug output.
--
Yao (éå)
2012-01-04 Yao Qi <yao@codesourcery.com>
* tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
defined.
[IN_PROCESS_AGENT] (debug_agent): New global variable.
---
gdb/gdbserver/tracepoint.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 524fa77..ba0bc1f 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -67,9 +67,13 @@ trace_vdebug (const char *fmt, ...)
va_end (ap);
}
+#ifdef IN_PROCESS_AGENT
+#define debug_threads debug_agent
+#endif
+
#define trace_debug_1(level, fmt, args...) \
do { \
- if (level <= debug_threads) \
+ if (level <= debug_threads) \
trace_vdebug ((fmt), ##args); \
} while (0)
@@ -366,7 +370,7 @@ tracepoint_look_up_symbols (void)
GDBserver side. */
#ifdef IN_PROCESS_AGENT
-int debug_threads = 0;
+int debug_agent = 0;
int
read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
--
1.7.0.4