* [patch v3 01/16] gdbserver, build: add -DGDBSERVER
@ 2012-08-15 7:59 markus.t.metzger
2012-08-23 14:41 ` Tom Tromey
0 siblings, 1 reply; 8+ messages in thread
From: markus.t.metzger @ 2012-08-15 7:59 UTC (permalink / raw)
To: gdb-patches
Cc: markus.t.metzger, jan.kratochvil, palves, tromey, kettenis, dje,
Markus Metzger
From: Markus Metzger <markus.t.metzger@intel.com>
A use of common/vec.h in gdbserver may result in compile errors if GDBSERVER is
not defined.
Add -DGDBSERVER to all gdbserver cflags.
2012-08-15 Markus Metzger <markus.t.metzger@intel.com>
gdbserver/
* Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
(various make rules): Remove -DGDBSERVER
---
gdb/gdbserver/Makefile.in | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index f62799e..9ca2732 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -111,7 +111,7 @@ CFLAGS = @CFLAGS@
INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \
${PROFILE_CFLAGS} ${INCLUDE_CFLAGS}
INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
-INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS)
+INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
@@ -447,7 +447,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
# Note, we only build the IPA if -fvisibility=hidden is supported in
# the first place.
IPAGENT_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
- -fPIC -DGDBSERVER -DIN_PROCESS_AGENT \
+ -fPIC -DIN_PROCESS_AGENT \
-fvisibility=hidden
# In-process agent object rules
@@ -494,40 +494,40 @@ gdbreplay.o: gdbreplay.c config.h
dll.o: dll.c $(server_h)
signals.o: ../common/signals.c $(server_h) $(signals_def)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
linux-procfs.o: ../common/linux-procfs.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
linux-ptrace.o: ../common/linux-ptrace.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
common-utils.o: ../common/common-utils.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
vec.o: ../common/vec.c $(vec_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
gdb_vecs.o: ../common/gdb_vecs.c $(vec_h) $(gdb_vecs_h) $(host_defs_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
xml-utils.o: ../common/xml-utils.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h) ../common/gdb_dirent.h
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
ptid.o: ../common/ptid.c $(ptid_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
buffer.o: ../common/buffer.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
format.o: ../common/format.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
agent.o: ../common/agent.c $(server_h) $(agent_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
# We build vasprintf with -DHAVE_CONFIG_H because we want that unit to
# include our config.h file. Otherwise, some system headers do not get
--
1.7.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [patch v3 01/16] gdbserver, build: add -DGDBSERVER
2012-08-15 7:59 [patch v3 01/16] gdbserver, build: add -DGDBSERVER markus.t.metzger
@ 2012-08-23 14:41 ` Tom Tromey
2012-08-24 6:37 ` Metzger, Markus T
0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2012-08-23 14:41 UTC (permalink / raw)
To: markus.t.metzger
Cc: gdb-patches, markus.t.metzger, jan.kratochvil, palves, kettenis, dje
>>>>> "markus" == markus t metzger <markus.t.metzger@intel.com> writes:
Markus> 2012-08-15 Markus Metzger <markus.t.metzger@intel.com>
Markus> gdbserver/
Markus> * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
Markus> (various make rules): Remove -DGDBSERVER
This is ok. Thanks.
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [patch v3 01/16] gdbserver, build: add -DGDBSERVER
2012-08-23 14:41 ` Tom Tromey
@ 2012-08-24 6:37 ` Metzger, Markus T
2012-08-24 13:47 ` Tom Tromey
0 siblings, 1 reply; 8+ messages in thread
From: Metzger, Markus T @ 2012-08-24 6:37 UTC (permalink / raw)
To: Tom Tromey
Cc: gdb-patches, markus.t.metzger, jan.kratochvil, palves, kettenis, dje
> -----Original Message-----
> From: Tom Tromey [mailto:tromey@redhat.com]
> Sent: Thursday, August 23, 2012 4:41 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org; markus.t.metzger@gmail.com; jan.kratochvil@redhat.com; palves@redhat.com;
> kettenis@gnu.org; dje@google.com
> Subject: Re: [patch v3 01/16] gdbserver, build: add -DGDBSERVER
>
> >>>>> "markus" == markus t metzger <markus.t.metzger@intel.com> writes:
>
> Markus> 2012-08-15 Markus Metzger <markus.t.metzger@intel.com>
> Markus> gdbserver/
> Markus> * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
> Markus> (various make rules): Remove -DGDBSERVER
>
> This is ok. Thanks.
Thanks. Just to clarify, when you say it's ok, this means that the changes have been approved and someone may commit them on my behalf, correct?
Did you look at the other patches, as well? The first four are rather small and generic. It would be good if they could be committed independently. This would shorten the series which might make it easier to review the rest.
Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer, Christian Lamprechter
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch v3 01/16] gdbserver, build: add -DGDBSERVER
2012-08-24 6:37 ` Metzger, Markus T
@ 2012-08-24 13:47 ` Tom Tromey
2012-09-10 6:48 ` Metzger, Markus T
0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2012-08-24 13:47 UTC (permalink / raw)
To: Metzger, Markus T
Cc: gdb-patches, markus.t.metzger, jan.kratochvil, palves, kettenis, dje
>>>>> "Markus" == Metzger, Markus T <markus.t.metzger@intel.com> writes:
Markus> Thanks. Just to clarify, when you say it's ok, this means that the
Markus> changes have been approved and someone may commit them on my behalf,
Markus> correct?
Yeah, or you can do it.
Contact me off-list and I will set you up with write-after-approval
access to the repository.
Markus> Did you look at the other patches, as well? The first four are rather
Markus> small and generic. It would be good if they could be committed
Markus> independently. This would shorten the series which might make it
Markus> easier to review the rest.
I haven't yet, but thanks for the note, I will look at those.
Tom
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [patch v3 01/16] gdbserver, build: add -DGDBSERVER
2012-08-24 13:47 ` Tom Tromey
@ 2012-09-10 6:48 ` Metzger, Markus T
0 siblings, 0 replies; 8+ messages in thread
From: Metzger, Markus T @ 2012-09-10 6:48 UTC (permalink / raw)
To: Tom Tromey
Cc: gdb-patches, markus.t.metzger, jan.kratochvil, palves, kettenis, dje
> -----Original Message-----
> From: Tom Tromey [mailto:tromey@redhat.com]
> Sent: Friday, August 24, 2012 3:48 PM
> To: Metzger, Markus T
> Markus> Did you look at the other patches, as well? The first four are rather
> Markus> small and generic. It would be good if they could be committed
> Markus> independently. This would shorten the series which might make it
> Markus> easier to review the rest.
>
> I haven't yet, but thanks for the note, I will look at those.
Thanks, that would be great.
Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Peter Gleissner, Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
^ permalink raw reply [flat|nested] 8+ messages in thread
* [patch v3 00/16] branch tracing support for Atom
@ 2012-08-14 13:01 markus.t.metzger
2012-08-14 13:00 ` [patch v3 01/16] gdbserver, build: add -DGDBSERVER markus.t.metzger
0 siblings, 1 reply; 8+ messages in thread
From: markus.t.metzger @ 2012-08-14 13:01 UTC (permalink / raw)
To: gdb-patches
Cc: markus.t.metzger, jan.kratochvil, palves, tromey, kettenis,
Markus Metzger
From: Markus Metzger <markus.t.metzger@intel.com>
If I counted correctly, this is the third version, not counting the identical
resend of the first version.
I incorporated review comments from Jan and Tom.
There are still open points regarding documentation, which is completely
missing, and a comment from Tom about the cli, on which the communication got
stuck.
There's a new patch at the end of the series to restrict the feature to Atom
processors using a cpuid whitelist.
The first four patches are generic and may find usage outside of this
series. Maybe there's a chance to approve them independently so the series gets
less intimidating to review.
Here's an overview of the feature:
Branch tracing is very useful to debug problems that do not immediatly result in
a crash. It is particularly useful for bugs that make other debugger features
fail, e.g. a corrupted stack that breaks unwinding.
In comparison with reverse debugging, branch tracing is less powerful but
faster. In addition, the list view (see below) provides a quick overview of
where you are, comparable with the backtrace command.
This series adds commands to enable/disable branch tracing as well as to display
the recorded trace. I do expect some discussion around the commands and their
exact spelling and would therefore postpone documentation.
- "btrace enable/disable" perform the obvious operation
They accept an optional range argument specifying the range of threads to
enable/disable branch tracing for. If no argument is given, they target the
current thread.
They further accept the following arguments:
all targets all threads
auto turns automatic enabling for new threads on/off
- "btrace list" prints the blocks that have been traced; one line per block.
The output may be configured using modifiers (default: /fl). It prints:
the block number
/a the begin and end code address of that block
/f the function containing the block
/l the source lines contained in the block
It accepts an optional range argument specifying the range of blocks to be
listed. If no argument is given, all blocks are listed.
Blocks are ordered from newest to oldest; block 1 always contains the
current location.
(gdb) btrace list 24-34
24 in stdio_file_flush () at ../../../git/gdb/ui-file.c:525-529
25 in ui_file_data () at ../../../git/gdb/ui-file.c:175-180
26 in stdio_file_flush () at ../../../git/gdb/ui-file.c:522-523
27 in gdb_flush () at ../../../git/gdb/ui-file.c:185
28 in gdb_wait_for_event () at ../../../git/gdb/event-loop.c:840-847
29 in gdb_do_one_event () at ../../../git/gdb/event-loop.c:461
30 in gdb_do_one_event () at ../../../git/gdb/event-loop.c:453
31 in process_event () at ../../../git/gdb/event-loop.c:407
32 in process_event () at ../../../git/gdb/event-loop.c:361-367
33 in process_event () at ../../../git/gdb/event-loop.c:1041-1043
34 in process_event () at ../../../git/gdb/event-loop.c:1041-1045
- "btrace" prints the branch trace disassembly
Branch trace is printed block-by-block. Typically, one block at a time is
printed. Repeated commands will iterate over all blocks similar to the list
command.
It supports the /m and /r modifiers accepted by the disassemble command.
It accepts an optional range argument specifying the range of blocks to be
printed. If more than one block is given, blocks are printed in reverse
order to preserve the original control flow.
(gdb) btrace /m 25
../../../git/gdb/ui-file.c:175 {
0x0000000000635410 <ui_file_data+0>: sub $0x8,%rsp
../../../git/gdb/ui-file.c:176 if (file->magic != &ui_file_magic)
0x0000000000635414 <ui_file_data+4>: cmpq $0xb33b94,(%rdi)
0x000000000063541b <ui_file_data+11>: jne 0x635426 <ui_file_data+22>
../../../git/gdb/ui-file.c:177 internal_error (__FILE__, __LINE__,
0x000000000063541d <ui_file_data+13>: mov 0x50(%rdi),%rax
../../../git/gdb/ui-file.c:178 _("ui_file_data: bad magic number"));
../../../git/gdb/ui-file.c:179 return file->to_data;
../../../git/gdb/ui-file.c:180 }
0x0000000000635421 <ui_file_data+17>: add $0x8,%rsp
0x0000000000635425 <ui_file_data+21>: retq
Mixed source and disassembly does not work very well for inlined functions,
a problem that it shares with the disassemble command.
Barkha Ahuja (1):
test, btrace: more branch tracing tests
Markus Metzger (15):
gdbserver, build: add -DGDBSERVER
disas: add precise instructions flag
source: add flags to print_source_lines ()
source, disasm: optionally prefix source lines with filename
thread, btrace: add generic branch trace support
cli, btrace: add btrace cli
configure: add check for perf_event header
linux, btrace: perf_event based branch tracing
linux, i386, amd64: enable btrace for 32bit and 64bit linux native
xml, btrace: define btrace xml document style
remote, btrace: add branch trace remote ops
gdbserver, btrace: add generic btrace support
gdbserver, linux, btrace: add btrace support for linux-low
test, btrace: add branch tracing tests
btrace, x86: restrict to Atom
gdb/Makefile.in | 13 +-
gdb/amd64-linux-nat.c | 51 ++
gdb/btrace.c | 866 ++++++++++++++++++++++
gdb/btrace.h | 77 ++
gdb/command.h | 2 +-
gdb/common/btrace-common.h | 56 ++
gdb/common/linux-btrace.c | 382 ++++++++++
gdb/common/linux-btrace.h | 76 ++
gdb/config.in | 3 +
gdb/config/i386/linux.mh | 3 +-
gdb/config/i386/linux64.mh | 2 +-
gdb/configure | 2 +-
gdb/configure.ac | 2 +-
gdb/disasm.c | 38 +-
gdb/disasm.h | 8 +-
gdb/features/btrace.dtd | 12 +
gdb/gdbserver/Makefile.in | 33 +-
gdb/gdbserver/config.in | 3 +
gdb/gdbserver/configure | 2 +-
gdb/gdbserver/configure.ac | 2 +-
gdb/gdbserver/configure.srv | 34 +-
gdb/gdbserver/gdbthread.h | 5 +
gdb/gdbserver/inferiors.c | 3 +
gdb/gdbserver/linux-low.c | 44 ++
gdb/gdbserver/linux-low.h | 2 +
gdb/gdbserver/linux-x86-low.c | 31 +
gdb/gdbserver/server.c | 167 +++++
gdb/gdbserver/target.h | 33 +
gdb/gdbthread.h | 4 +
gdb/i386-linux-nat.c | 51 ++
gdb/i386-linux-tdep.c | 34 +
gdb/i386-linux-tdep.h | 3 +
gdb/infcmd.c | 2 +
gdb/remote.c | 157 ++++
gdb/source.c | 21 +-
gdb/symtab.h | 14 +-
gdb/target.c | 89 +++
gdb/target.h | 39 +-
gdb/testsuite/Makefile.in | 3 +-
gdb/testsuite/configure | 3 +-
gdb/testsuite/configure.ac | 2 +-
gdb/testsuite/gdb.base/page.exp | 3 +-
gdb/testsuite/gdb.btrace/Makefile.in | 13 +
gdb/testsuite/gdb.btrace/a.S | 23 +
gdb/testsuite/gdb.btrace/allthreads_trace.exp | 345 +++++++++
gdb/testsuite/gdb.btrace/amd64-thr-callback.S | 116 +++
gdb/testsuite/gdb.btrace/b.S | 23 +
gdb/testsuite/gdb.btrace/dec.c | 23 +
gdb/testsuite/gdb.btrace/decrement.S | 32 +
gdb/testsuite/gdb.btrace/decrement.exp | 141 ++++
gdb/testsuite/gdb.btrace/disable_all.exp | 279 +++++++
gdb/testsuite/gdb.btrace/enable.exp | 94 +++
gdb/testsuite/gdb.btrace/enable_all.exp | 282 +++++++
gdb/testsuite/gdb.btrace/enable_range.exp | 281 +++++++
gdb/testsuite/gdb.btrace/i386-thr-callback.S | 116 +++
gdb/testsuite/gdb.btrace/inc.c | 23 +
gdb/testsuite/gdb.btrace/list.exp | 175 +++++
gdb/testsuite/gdb.btrace/list_function.c | 31 +
gdb/testsuite/gdb.btrace/list_function.exp | 50 ++
gdb/testsuite/gdb.btrace/list_options.exp | 107 +++
gdb/testsuite/gdb.btrace/main.S | 36 +
gdb/testsuite/gdb.btrace/main_asm.exp | 109 +++
gdb/testsuite/gdb.btrace/main_segv.S | 32 +
gdb/testsuite/gdb.btrace/main_segv.exp | 84 +++
gdb/testsuite/gdb.btrace/threads.c | 96 +++
gdb/testsuite/gdb.btrace/threads_asm.c | 78 ++
gdb/testsuite/gdb.btrace/threads_auto.exp | 123 +++
gdb/testsuite/gdb.btrace/threads_independent.exp | 125 ++++
gdb/testsuite/gdb.btrace/threads_nonstop.exp | 231 ++++++
gdb/testsuite/gdb.btrace/trace_iteration.exp | 265 +++++++
gdb/testsuite/gdb.btrace/x86-list.S | 70 ++
gdb/testsuite/lib/btrace.exp | 78 ++
gdb/thread.c | 4 +
73 files changed, 5796 insertions(+), 66 deletions(-)
create mode 100644 gdb/btrace.c
create mode 100644 gdb/btrace.h
create mode 100644 gdb/common/btrace-common.h
create mode 100644 gdb/common/linux-btrace.c
create mode 100644 gdb/common/linux-btrace.h
create mode 100644 gdb/features/btrace.dtd
create mode 100755 gdb/testsuite/gdb.btrace/Makefile.in
create mode 100755 gdb/testsuite/gdb.btrace/a.S
create mode 100755 gdb/testsuite/gdb.btrace/allthreads_trace.exp
create mode 100755 gdb/testsuite/gdb.btrace/amd64-thr-callback.S
create mode 100755 gdb/testsuite/gdb.btrace/b.S
create mode 100644 gdb/testsuite/gdb.btrace/dec.c
create mode 100755 gdb/testsuite/gdb.btrace/decrement.S
create mode 100755 gdb/testsuite/gdb.btrace/decrement.exp
create mode 100755 gdb/testsuite/gdb.btrace/disable_all.exp
create mode 100644 gdb/testsuite/gdb.btrace/enable.exp
create mode 100755 gdb/testsuite/gdb.btrace/enable_all.exp
create mode 100755 gdb/testsuite/gdb.btrace/enable_range.exp
create mode 100755 gdb/testsuite/gdb.btrace/i386-thr-callback.S
create mode 100644 gdb/testsuite/gdb.btrace/inc.c
create mode 100644 gdb/testsuite/gdb.btrace/list.exp
create mode 100644 gdb/testsuite/gdb.btrace/list_function.c
create mode 100644 gdb/testsuite/gdb.btrace/list_function.exp
create mode 100755 gdb/testsuite/gdb.btrace/list_options.exp
create mode 100755 gdb/testsuite/gdb.btrace/main.S
create mode 100755 gdb/testsuite/gdb.btrace/main_asm.exp
create mode 100755 gdb/testsuite/gdb.btrace/main_segv.S
create mode 100755 gdb/testsuite/gdb.btrace/main_segv.exp
create mode 100755 gdb/testsuite/gdb.btrace/threads.c
create mode 100755 gdb/testsuite/gdb.btrace/threads_asm.c
create mode 100755 gdb/testsuite/gdb.btrace/threads_auto.exp
create mode 100755 gdb/testsuite/gdb.btrace/threads_independent.exp
create mode 100755 gdb/testsuite/gdb.btrace/threads_nonstop.exp
create mode 100755 gdb/testsuite/gdb.btrace/trace_iteration.exp
create mode 100644 gdb/testsuite/gdb.btrace/x86-list.S
create mode 100644 gdb/testsuite/lib/btrace.exp
^ permalink raw reply [flat|nested] 8+ messages in thread* [patch v3 01/16] gdbserver, build: add -DGDBSERVER
2012-08-14 13:01 [patch v3 00/16] branch tracing support for Atom markus.t.metzger
@ 2012-08-14 13:00 ` markus.t.metzger
2012-08-15 0:41 ` Doug Evans
0 siblings, 1 reply; 8+ messages in thread
From: markus.t.metzger @ 2012-08-14 13:00 UTC (permalink / raw)
To: gdb-patches
Cc: markus.t.metzger, jan.kratochvil, palves, tromey, kettenis,
Markus Metzger
From: Markus Metzger <markus.t.metzger@intel.com>
A use of common/vec.h in gdbserver may result in compile errors if GDBSERVER is
not defined.
Add -DGDBSERVER to all gdbserver cflags.
2012-08-14 Markus Metzger <markus.t.metzger@intel.com>
gdbserver/
* Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
(various make rules): Remove -DGDBSERVER
---
gdb/gdbserver/Makefile.in | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index f62799e..ae5a60e 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -113,6 +113,9 @@ INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \
INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS)
+# Let all files know we're compiling for gdbserver.
+INTERNAL_CFLAGS += -DGDBSERVER
+
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
LDFLAGS = @LDFLAGS@
@@ -447,7 +450,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
# Note, we only build the IPA if -fvisibility=hidden is supported in
# the first place.
IPAGENT_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
- -fPIC -DGDBSERVER -DIN_PROCESS_AGENT \
+ -fPIC -DIN_PROCESS_AGENT \
-fvisibility=hidden
# In-process agent object rules
@@ -494,40 +497,40 @@ gdbreplay.o: gdbreplay.c config.h
dll.o: dll.c $(server_h)
signals.o: ../common/signals.c $(server_h) $(signals_def)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
linux-procfs.o: ../common/linux-procfs.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
linux-ptrace.o: ../common/linux-ptrace.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
common-utils.o: ../common/common-utils.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
vec.o: ../common/vec.c $(vec_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
gdb_vecs.o: ../common/gdb_vecs.c $(vec_h) $(gdb_vecs_h) $(host_defs_h)
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
xml-utils.o: ../common/xml-utils.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h) ../common/gdb_dirent.h
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
ptid.o: ../common/ptid.c $(ptid_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
buffer.o: ../common/buffer.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
format.o: ../common/format.c $(server_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
agent.o: ../common/agent.c $(server_h) $(agent_h)
- $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
# We build vasprintf with -DHAVE_CONFIG_H because we want that unit to
# include our config.h file. Otherwise, some system headers do not get
--
1.7.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [patch v3 01/16] gdbserver, build: add -DGDBSERVER
2012-08-14 13:00 ` [patch v3 01/16] gdbserver, build: add -DGDBSERVER markus.t.metzger
@ 2012-08-15 0:41 ` Doug Evans
2012-08-15 7:59 ` Metzger, Markus T
0 siblings, 1 reply; 8+ messages in thread
From: Doug Evans @ 2012-08-15 0:41 UTC (permalink / raw)
To: markus.t.metzger
Cc: gdb-patches, markus.t.metzger, jan.kratochvil, palves, tromey, kettenis
On Tue, Aug 14, 2012 at 5:59 AM, <markus.t.metzger@intel.com> wrote:
> From: Markus Metzger <markus.t.metzger@intel.com>
>
> A use of common/vec.h in gdbserver may result in compile errors if GDBSERVER is
> not defined.
>
> Add -DGDBSERVER to all gdbserver cflags.
>
> 2012-08-14 Markus Metzger <markus.t.metzger@intel.com>
>
> gdbserver/
> * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
> (various make rules): Remove -DGDBSERVER
>
>
> ---
> gdb/gdbserver/Makefile.in | 27 +++++++++++++++------------
> 1 files changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
> index f62799e..ae5a60e 100644
> --- a/gdb/gdbserver/Makefile.in
> +++ b/gdb/gdbserver/Makefile.in
> @@ -113,6 +113,9 @@ INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \
> INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
> INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS)
>
> +# Let all files know we're compiling for gdbserver.
> +INTERNAL_CFLAGS += -DGDBSERVER
> +
> # LDFLAGS is specifically reserved for setting from the command line
> # when running make.
> LDFLAGS = @LDFLAGS@
> @@ -447,7 +450,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
> # Note, we only build the IPA if -fvisibility=hidden is supported in
> # the first place.
> IPAGENT_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
> - -fPIC -DGDBSERVER -DIN_PROCESS_AGENT \
> + -fPIC -DIN_PROCESS_AGENT \
> -fvisibility=hidden
"+=" is a GNU make-ism, I think we can't use it here.
Plus you missed one:
gdb_vecs.o: ../common/gdb_vecs.c $(vec_h) $(gdb_vecs_h) $(host_defs_h)
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
^ permalink raw reply [flat|nested] 8+ messages in thread* RE: [patch v3 01/16] gdbserver, build: add -DGDBSERVER
2012-08-15 0:41 ` Doug Evans
@ 2012-08-15 7:59 ` Metzger, Markus T
0 siblings, 0 replies; 8+ messages in thread
From: Metzger, Markus T @ 2012-08-15 7:59 UTC (permalink / raw)
To: Doug Evans
Cc: gdb-patches, markus.t.metzger, jan.kratochvil, palves, tromey, kettenis
> -----Original Message-----
> From: Doug Evans [mailto:dje@google.com]
> Sent: Wednesday, August 15, 2012 2:41 AM
Thanks for your review!
[...]
> > +# Let all files know we're compiling for gdbserver.
> > +INTERNAL_CFLAGS += -DGDBSERVER
[...]
> "+=" is a GNU make-ism, I think we can't use it here.
>
> Plus you missed one:
>
> gdb_vecs.o: ../common/gdb_vecs.c $(vec_h) $(gdb_vecs_h) $(host_defs_h)
> $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
Fixed both. Gdb/common is growing very fast - that's good. I'll send an updated patch.
Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer, Christian Lamprechter
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-09-10 6:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 7:59 [patch v3 01/16] gdbserver, build: add -DGDBSERVER markus.t.metzger
2012-08-23 14:41 ` Tom Tromey
2012-08-24 6:37 ` Metzger, Markus T
2012-08-24 13:47 ` Tom Tromey
2012-09-10 6:48 ` Metzger, Markus T
-- strict thread matches above, loose matches on Subject: below --
2012-08-14 13:01 [patch v3 00/16] branch tracing support for Atom markus.t.metzger
2012-08-14 13:00 ` [patch v3 01/16] gdbserver, build: add -DGDBSERVER markus.t.metzger
2012-08-15 0:41 ` Doug Evans
2012-08-15 7:59 ` Metzger, Markus T
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox